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
New Developer
Posts: 54
Registered: ‎01-14-2009
My Device: Not Specified

How to determine alternate entry point argument for another application?

I have application that comprises an auto-start background application, and a foreground GUI application that is launched using an alternate entry point and a custom argument, say "abc". In my application's main, if I see the argument "abc", I launch the foreground application, otherwise I launch the background application.

 

Now, is it possible for another application to automatically determine that argument, so it can launch my application's foreground? When you launch another application with the application manager, you have to pass in an application descriptor with arguments defined. I would think that another application should be able to determine the arguments another application is looking for automatically?

 

Developer
Posts: 238
Registered: ‎08-26-2008
My Device: Not Specified

Re: How to determine alternate entry point argument for another application?

Hi,

 

just don't care about your application in background.

Check for AppName in ApplicationManager for running apps.

If found then requestForeground for that app not caring about ui or non ui app.

 

Regards,

Jochen

Developer
Posts: 432
Registered: ‎02-23-2009
My Device: Not Specified

Re: How to determine alternate entry point argument for another application?

You can check the argument in main method and do the processing as per arguments. Make your requirement more clear to get specific answer

 


Press the kudos button to thank the user who helped you.

If your problem was get solved then please mark the thread as "Accepted solution".

 

 

 

 

Deepesh Gupta
Developer
Posts: 26
Registered: ‎08-04-2008
My Device: Not Specified

Re: How to determine alternate entry point argument for another application?

Hi Shrute,

 

Got it. Smiley Happy

 

Your application is not already running and you want to start  the application from another external application.

 

Also you need to identify "frrom where the application was invoked?" am i right?

 

Say Your application name (The main module name ) is "MySampleApp"

 

use this code :

ApplicationManager manager = ApplicationManager.getApplicationManager(); int modHandle = CodeModuleManager.getModuleHandle(MySampleApp); // get a handle on the module ApplicationDescriptor[] apDes = CodeModuleManager.getApplicationDescriptors( modHandle ); // descriptor of the module. ApplicationDescriptor descriptor = apDes[0]; String[] args = {"abc"}; // Create new descriptor with "your own arguments" ApplicationDescriptor newDescriptor = new ApplicationDescriptor(descriptor, descriptor.getName(), args); // run application manager.runApplication( descriptor );

 

 

 

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

Re: How to determine alternate entry point argument for another application?

[ Edited ]

I don't think that anyone has answered this question from shrute:

"I would think that another application should be able to determine the arguments another application is looking for automatically?"

 

I must be honest, I don't know if you can figure this out.  Anyone?

Message Edited by peter_strange on 03-24-2009 12:30 PM
BlackBerry Development Advisor
Posts: 15,803
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: How to determine alternate entry point argument for another application?

There is no BlackBerry API to query for the application arguments of an application.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.