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
Contributor
Posts: 13
Registered: ‎08-17-2012
My Device: BlackBerry Bold 9790
My Carrier: Comcel
Accepted Solution

How to start a process

I'm shocked to discover that classes like ProcessBuilder and Process and the Runtime.exec methods are not in the BB Java API. How does one start a process in BB?

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to start a process

[ Edited ]

You don't start a process in BlackBerry, you start and Application, an there are various class like ApplicationManager that you can use to do this.

 

You can of course start Threads within your own Application if you want - see the Thread class. 

 

If you describe what you are trying to achieve we might be able to tell you how to do it in BlackBerry Land. 

Contributor
Posts: 13
Registered: ‎08-17-2012
My Device: BlackBerry Bold 9790
My Carrier: Comcel

Re: How to start a process

Thanks, ApplicationManager looks like what I need. One thing though: the docs for ApplicationManager show an example of running an application passing ApplicationDescriptor.currentApplicationDescriptor() to ApplicationManager.runApplication. Does that run another instance of the current application?

Also, the docs for ApplicationManager.runApplication say that no process is created if a process has already been created for the specified descriptor. How does the example work then?
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to start a process

Not sure which documentation you are looking at but the OS 5.0 doc says this:

 

appmanager.runApplication(newdescriptor);

 

where newdescriptor is the current descriptor with different start-up arguments - so this is not the same ApplicationDescriptor and so not the same 'process'.  But you are right.  If the Application that attempted to schedule this was actually started with the same arguments ({ "admin", "secure" }) that you give to newdescriptor, then there would be no effect, the BB OS would just note that the required Application was already running and ignore the "run".

 

OK?

Contributor
Posts: 13
Registered: ‎08-17-2012
My Device: BlackBerry Bold 9790
My Carrier: Comcel

Re: How to start a process

Yes it's clear now Smiley Wink