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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Posts: 554
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700
My Carrier: Movistar, Telenor
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
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

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? Smiley Happy

Developer
Posts: 554
Registered: ‎10-31-2009
My Device: Torch 9800, Bold 9700
My Carrier: Movistar, Telenor

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
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

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. Smiley Happy

Developer
Posts: 17,026
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

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