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: 22
Registered: ‎01-16-2009
My Device: Not Specified
Accepted Solution

Terminating a background-process

Dear all,


short question: I have two background-processes. One process may be notified to shut itself down by SMS. But when it shuts down I want to shut down my second process as well. Whats the best way to do this?

I am thinking of placing a "note" into the runtime-store before shutting down the first process. If the second process reads the note it shuts down as well. Problem: I may deinstall my first process and then I need a reboot. After the reboot my note is lost (the second process sleeps most of the time...) and the second process wont shut down... Same problem using persistent store when removing my application....

Any ideas?

 

Thanks!

Steve

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

Re: Terminating a background-process

if you use generic persistant objects, like a string for example or a Boolean, they do not get removed when you uninstall an application.
----------------------------------------------------------
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
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Terminating a background-process

Further to Simon's note, RuntimeStore does not survive a reboot, so don't put a note in there.

 

You might also consider putting code into the second application to see if the first is actually there.  Never done this myself, but if I was too, I would look at ApplicationManager to see if the application is running or CodeModuleManager to see if the associated cod was there.  But I suspect either of these is a more work than using PersistentStore.

Developer
Posts: 22
Registered: ‎01-16-2009
My Device: Not Specified

Re: Terminating a background-process

Hi Simon, hi Peter,

 

thanks for your replies! I will but a boolean in the persistent-store then.

 

Peter: I know the cod is there and running, i check it using the ApplicationManager. But nevertheless I cant terminate a application using the ApplicationManager, or do i misunderstand something?

 

Thanks again,

Steve

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

Re: Terminating a background-process

if the application is yours you can send a termination command via 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
Developer
Posts: 22
Registered: ‎01-16-2009
My Device: Not Specified

Re: Terminating a background-process

i knew i missed something! thanks thats the solution i was looking for!
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Terminating a background-process

My post was intended to assist in the case when you had removed the first application and so did not want the second running.  I am not aware of any way through ApplicationManager that you can terminate another application, but I've never really wanted to do anything like that so I've never looked.
Developer
Posts: 22
Registered: ‎01-16-2009
My Device: Not Specified

Re: Terminating a background-process

sorry i misplaced the solution-button. any chance to change that ...?!?

 

 

Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: Terminating a background-process

[ Edited ]

Original:

Some people ask questions

 

Some experts answers questions

 

questioner, says thanks thats the solution and mark their own reply as accepted solution, rather putting the solution as accepted

:LMAO:

 

Edited:

Sorry buddy, I thought it was not by mistake :LOL:

Message Edited by mantaker on 03-28-2009 09:26 AM
--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Terminating a background-process