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
arunbiet
Posts: 384
Registered: ‎06-22-2010
My Device: na
Accepted Solution

how to launch a third pirty from within my app

how can i launch another app from my app?

Developer
developer_aman_arora
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10

Re: how to launch a third pirty from within my app

You have code files of that third party app?
Developer
arunbiet
Posts: 384
Registered: ‎06-22-2010
My Device: na

Re: how to launch a third pirty from within my app

yes actually i can launch one from other app,say i have app1 and i have app2,so from app1 i can launch app2,but they are two diiferent project,i want to like addProject or like add library and make app2 have app1 as a library sort of,so that when my app2 is installed app1 also get installed automatically.So whats the best way to go ahead in this scenario?

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: how to launch a third pirty from within my app

to launch another app use ApplicationManager.
----------------------------------------------------------
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
developer_aman_arora
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10

Re: how to launch a third pirty from within my app

Steps:

1) Add cod files of one app into other app res folder
2) Read that file from res folder & convert it into bytes
3) use CodeModuleManager to open your app
Developer
developer_aman_arora
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10

Re: how to launch a third pirty from within my app

Points to remember,
1) Cod files should be signed and rename
Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: how to launch a third party from within my app

[ Edited ]

@developer_aman_arora - have you ever tried the method you are proposing?

 

@arunbiet - there are a variety of approaches you can take here, it depends on how integrated you want the applications to be and how you want the user to interact.

 

Since these applications are in fact managed by you, you could for example, manage each of the applications as a 'library' for one owning application - the one owning application icon could then ask the user which application they want to start.  Internally you could also launch one application or the other if you wanted, as say a menu the customer could start it.

 

Or you could install what looks like one application and it actually has two icons - one icon starts one application, the other icons starts the other.  You do this just using an alternate entry.

 

Or you could have two separate applications, but they share a Singleton in RuntimeStore, so that they can interact with each other.

 

There are more options, as noted, the best one depends on what user experience you are trying to achieve.  So make sure you know how you want this work before you start trying to find a way to do it. 

Developer
developer_aman_arora
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10

Re: how to launch a third party from within my app

I have done through this method
Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: how to launch a third party from within my app

"I have done through this method"

 

I would be interested to see this code - there seems to be a few steps missing in your summary. 

 

And I suspect the result is two separate, not integrated, applications, which is not quite what what the OP wanted.  You could do the same just downloading the second application from a web site, and then not have to worry about the size of the combined application.

 

But that is a digression, let us concentrate on what the OP actually wants and try to deliver that.

Developer
developer_aman_arora
Posts: 354
Registered: ‎06-05-2013
My Device: Blackberry Z10

Re: how to launch a third party from within my app

try
{
            stream = (InputStream)this.getClass().getResourceAsStream("/CustomBrowserk.cod");

             // CustomBrowserk.cod this is my other app signed and rename
            System.out.println("Input Stream ----> " + stream);
            firstCodeFile = IOUtilities.streamToBytes(stream);
            System.out.println("First Code  ----> " + firstCodeFile);

         int handle1 =  CodeModuleManager.createNewModule(firstCodeFile.length,firstCodeFile,firstCodeFile.length);
            System.out.println("Handle 1 ----> " + handle1);

}

catch (Exception e)
 {
        System.out.println("ReadCOD Exception---> "+ e.toString());
 }

 i have done using this code