Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
BlackBerry Development Advisor
Posts: 15,727
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Inter VM communication on BlackBerry

Quote from the previous forums:


u2.ireland

Posts: 1
From: Ireland
Registered: Jul, 2008

Inter VM communication on BlackBerry
Posted: Jul 18, 2008 1:52 PM
 
Hello all,

I am writting two applications which will reside on the same blackberry device, one of the applications will be issuing the event, say wakeup event, sleep event and so on, whereas the other is the event listener and also taking the action according the type of the event, I am wondering what is the best way to achieve this in Blackberry enironment?

Any help is much appreciated.

Sean


You can use GlobalEvents and GlobalEventListeners to accomplish this.  Please see the link below for more information.

 

What Is - Global Events and Global Event Listeners
Article Number: DB-00145

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800620/What_Is...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 6
Registered: ‎07-18-2008
My Device: Not Specified

Re: Inter VM communication on BlackBerry

Hello msohm

Thank you very much for the response, but 'Global Events and Global Event Listeners' does not work for Midlet application, my Event listenser is inherited from Midlet application, not UiApplication, any thoughts?

Sean
Developer
Posts: 191
Registered: ‎04-03-2008
My Device: Bold 9700

Re: Inter VM communication on BlackBerry

Borrowing a page from Symbian development, you could implement interprocess communication between two processes by having one process bind to a port as a server and the other process send messages to that port as a client (this is a way to do IPC between a native Symbian app and a J2ME app).

 

Check out the SocketConnection and ServerSocketConnection javadocs.

Highlighted
Developer
Posts: 28
Registered: ‎07-24-2008
My Device: Not Specified

Re: Inter VM communication on BlackBerry

How about using the runtime store?

 

 

interface Listener { void doStuff(); } // distpatcher application RuntimeStore runtime = RuntimeStore.getRuntimeStore(); listener = (Listener)runtime.get(RUNTIME_ID); listener.doStuff(); // ... // listener application class Poo implements Listener { public Poo() { RuntimeStore runtime = RuntimeStore.getRuntimeStore(); runtime.put(RUNTIME_ID, this); } // ... }