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
Developer
Posts: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

what are ways of invoking the Application

Hi ,I am trying to invoke the app from BBM App,Apart from browser filtering ,What are ways to invoke the app.

 

thanks

Rakesh Shankar.P

BlackBerry Development Advisor
Posts: 15,888
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: what are ways of invoking the Application

Which app, a built in one or your own?  Are you trying to invoke one app from another?  Or do you mean how can the application itself be started?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Developer
Posts: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

Re: what are ways of invoking the Application

I am sending some sort of link from my app through BBM to other user,on linking the app,i should invoke the app.How can i do it,apart from browser filtering?

 

Thanks

Rakesh shankar.P

Highlighted
Developer
Posts: 543
Registered: ‎12-23-2010
My Device: Z10
My Carrier: Airtel

Re: what are ways of invoking the Application

Hi Rakesh Shanker,

 

Before Invoke the Application you have to check the current state of the app.

 

Current state in the sense

 

1. The app is opened but it is in background.

 

2. The app is opened and it is foreground.

 

3. The app is not opened.

 

These are the three states. Now Checking the state of the app.

 

boolean isAppOpen = false;

int modHandle = CodeModuleManager.getModuleHandle(Your app .cod file name);

ApplicationDescriptor[] apDes = CodeModuleManager.getApplicationDescriptors(modHandle);

if(apDes != null)
 {

    ApplicationDescriptor[] foreground_apps = ApplicationManager.getApplicationManager().getVisibleApplications();

if(foreground_apps != null)
 {
  for(int i=0;i<foreground_apps.length;i++)
     {
       if(foreground_apps[i].equals(apDes[0]))
          {

           isAppOpen = true;

          process_id = ApplicationManager.getApplicationManager().getProcessId(apDes[0]);
          int fgprocess_id = ApplicationManager.getApplicationManager().getForegroundProcessId();
                                                            
             if(process_id == fgprocess_id)
                {
                     // This means that your app opened and it is foreground

                }
             else
             {
                //This means that your app is opened but it is background
                //Now request foreground
                ApplicationManager appManager = ApplicationManager.getApplicationManager();
                appManager.requestForeground(process_id);
              }

      }

    }

   }

if(!isAppOpen)
{

//This means that the app is not opened then you need to open the app.
ApplicationManager.getApplicationManager().runApplication(apDes[0]);
                                                    
}



Thanks.

 

Trusted Contributor
Posts: 151
Registered: ‎06-17-2010
My Device: Curve 8900
My Carrier: Vodafone

Re: what are ways of invoking the Application

nice post.. its really Helpful...
Developer
Posts: 543
Registered: ‎12-23-2010
My Device: Z10
My Carrier: Airtel

Re: what are ways of invoking the Application

Welcome