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
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone
Accepted Solution

What are all the ways we can open an app rather than clicking the app icon

Hi all,

What are all the ways we can open an app rather than clicking the app icon. Is it possible to open an app with another app with some keyword or something.....

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

Re: What are all the ways we can open an app rather than clicking the app icon

you can use ApplicationManager which provides two ways:
http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/system/ApplicationManager.html...
http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/system/ApplicationManager.html...

the second one is usually easier to use. you can modify the app descriptor if you want to add parameters in String[] args.
----------------------------------------------------------
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: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Re: What are all the ways we can open an app rather than clicking the app icon

i am able to launch only application that is running in the background..... How to launch the apps which is not in the background.

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

Re: What are all the ways we can open an app rather than clicking the app icon

Why do you say you can only launch background apps?

 

If you do a search round I think you will find other Threads that might be able to help you with this. 

Developer
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Re: What are all the ways we can open an app rather than clicking the app icon

[ Edited ]

This code returns me the apps which in the background

 

ApplicationManager manager = ApplicationManager.getApplicationManager();
ApplicationDescriptor descriptors[] = manager.getVisibleApplications();

try {
manager.getApplicationManager().runApplication(descriptors[2],
true);
} catch (ApplicationManagerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

 

 

And checked it with the below code 

String appname1 = "";
for(int i=0;i<descriptors.length;i++){
appname1 = appname1 +"\n"+ descriptors[i].getName();
}
LabelField field = new LabelField(appname1);
add(field);

 

it displaying only the apps which in the background...

 

However i will check other threads also....

Developer
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Re: What are all the ways we can open an app rather than clicking the app icon

I am able to launch an app with module name......

 

How to get the module names of all the installed apps in the phone?

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

Re: What are all the ways we can open an app rather than clicking the app icon

[ Edited ]

I don't know of anywhere that is published or any way of finding that out vai an API, sorry. 

 

Edit: But SImon does... See below...

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

Re: What are all the ways we can open an app rather than clicking the app icon

[ Edited ]

codemodulemanager

 

btw, if the original issue is solved, don't hesitate to mark the thread as solved and create a new one for a new question

----------------------------------------------------------
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