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
Developer
ingvar_e
Posts: 551
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700
Accepted Solution

Invoking my PhoneListener class

I have a phonelistener class that works with settings Autostart"  and "system". Now I want to start and stop it from my application. I am communicating with it via GlobalEvents so I guess I can use that to stop it. But how do I start from my application and what attributes should it have (like autostart, system,?)

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
Developer
johnbibs
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800

Re: Invoking my PhoneListener class

Hi ingvar_e,

 

Are referring to two applications? One is your GlobalEventListener and the other one is application which uses the first one? If yes, just set your GlobalEventListener app to run on startup. Then from there you can post a global event to start/stop it.

 

Just a question though, why would you like to do that when you can start and stop the listener without going through the GlobalEventListener? :smileyhappy:

Developer
ingvar_e
Posts: 551
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700

Re: Invoking my PhoneListener class

Hi johnbibs. thanks for answering

 

It is a bit of peculiar setup. I need to be able to control the behavior of the phonelistener, including stopping and starting it from an existing application. The phonelistener not only listens, it will perform certain actions by receiving commands via GlobalEvents from my application.  I cannot implement the phonelistener in my app, it has to be a separate module. So, yes in a sense it is 2 separate applications hence the global event communication. I only want the phonelistener to run when my application is running. So I start my application and it in turn should start the phonelistener. I have the technique for communication and the services the phonelistener should do in place.

 

For your information what is described above as "my application" is really just an interface module between an existing MIDLET from a different platform. That is not really relevant for the problem I have it just to explain why I have to use such a setup.

 

 

If everything seems to be under control, you're just not driving fast enough
-Mario Andretti-
Developer
johnbibs
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800

Re: Invoking my PhoneListener class

I see. Then you can just set your application to run on startup then. This application will just start up your GlobalEventListener. :smileyhappy:

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Invoking my PhoneListener class

you can start another app, in this case your background app, using applicationmanager. ending it would be done with your global event.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter