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

Native Development

Reply
Contributor
Posts: 15
Registered: ‎10-24-2011
My Device: playbook
My Carrier: none

launching other apps

How do we launch new app using its app id from another app..Say I have app id of calculator ie, sys.calculator.gYABgJidBvuZ89m_1j4PV2712.A    Now I want to lauch the calculator app from another app..how this can be achieved ???

 

For Browser, music player we have navigators to lauch as they have registered urls for lauching,,,How abt in general an app can be launched ???

 

 

regards

Arun

Developer
Posts: 110
Registered: ‎10-22-2011
My Device: PlayBook, Bold 9650, Dev Alpha A
My Carrier: Sprint

Re: launching other apps

I've discovered that I'm in need of this functionality, as well.

The alternative is wasting many megabytes of space on a user's device due to having to bundle the same binary over and over in a "runtime" configuration.

The basic use case is as follows: A user downloads the core app, which is fully functional on its own, from App World. The user then downloads something akin to an add-on pack that gives additional functionality. At this point, there are three options. First, and preferable, the "add-on" installs its files to a shared directory and then launches the main app with an argument to tell it to use the configuration in a specific file for that add-on. Second, and less preferable, is to include the same core app additionally in each add-on, causing the user to consume many more megabytes of storage but saving the first-launch copy step. Finally, and least preferable, the user launches the "add-on" to copy the files to the shared directory and then (and on subsequent launches) is instructed to launch the main app.

Note that in the first case, only rarely will the non-core apps get updates, thus saving time (and potentially money on metered WiFi/tethering) and confusion about which order to update in. And in the final case, the user will essentially have a totally useless icon on their screen that they can't delete (else they'll delete the "add-on"'s data in the shared folder, as well).

I can't find any situation where this would not be error-prone nor where it would be ideal.

(Note that I simply used the term "add-on" as most of the use cases I can think of fall under that very wide umbrella, aside from alternate launchers which I'm not concerned with.)


Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Like this post too! :smileyvery-happy:
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: launching other apps

Are these "add-ons" installed "applications" from App World? Where are they installing them from? Are you thinking that applications would reside in the shared directory? How would the initial application know where to use these "add-on" and what would happen if the user renames/moves/deletes these add-ons from the shared directory?
Developer
Posts: 110
Registered: ‎10-22-2011
My Device: PlayBook, Bold 9650, Dev Alpha A
My Carrier: Sprint

Re: launching other apps

[ Edited ]

Well, I abstracted out a bit. And without committing myself to things that may not be finished and may, of course, also not end up in App World, I'll elaborate more upon my needs.

In my case, it'd be an game engine. I'd like to be able to have free games using it available in App World (this is legally permitted in this case) using this engine. There are extant games available (not specifically targeted at the PlayBook) which can simply be played by copying them to the shared directory and launching the app.

Since the main app looks in a specific directory for both games installed by the user as well as games downloaded from the app store, it is functional standalone (and, indeed, if the user doesn't want to be limited to free games, this is a good thing).

From what I've seen of other apps that communicate with each other using files in the shared directory, I was envisioning that if the user starts the "add-on" and the files are not found, it offers to copy them. The user may, of course, decline.

As you can see, if the user installs a half dozen free games from App World, they add up quickly on the device if they can't share the runtime. This is especially prominent if the standalone runtime is also installed (assuming that they can't invoke one another). It also makes the games look less desirable if they have an extra double-digit megabyte weight on each, as I indicated earlier.

Hopefully in a day or two I'll be able to specify exactly what I'm working on and it will probably all make sense. In the mean time, I'm trying to be clear about the goals without giving too much away. :smileyhappy:



Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Like this post too! :smileyvery-happy:
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: launching other apps

If the game/addon is a file that when opened, used the installed app to "play" the game, that is more possible. If the file is an executable, I'm not certain if RIM would allow that for security reasons (malware,spyware,viruses). PB has not yet fully supported the ability to register file type and designate which app can open them. In AIR, the registering process can be done, but the PB has not implemented that.
Developer
Posts: 110
Registered: ‎10-22-2011
My Device: PlayBook, Bold 9650, Dev Alpha A
My Carrier: Sprint

Re: launching other apps

Yeah, in this case, it'd be a matter of making sure the data is where the main app can get to it (the shared dir sounds really good for that!) and then getting it to launch the app with an argument (e.g. the filename with the configuration data for that game).

I'm really hesitant to approach this in such a way where the user does not have a way to access the App-World-installed freebie games from the same interface as their paid-for-but-obtained-outside-App-World games. I still cannot see any way that it would be anything but confusing and a poor experience for the user.


Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Like this post too! :smileyvery-happy:
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: launching other apps

You can do in-app purchases from the app so everything is kept track in one place.
Developer
Posts: 110
Registered: ‎10-22-2011
My Device: PlayBook, Bold 9650, Dev Alpha A
My Carrier: Sprint

Re: launching other apps

I wouldn't have the rights to distribute the games myself, so the user would have to provide them. As I said, at this point, I can't go into too much detail. But in-app purchase won't work in the general case. :smileyhappy:


Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Like this post too! :smileyvery-happy:
BlackBerry Development Advisor
Posts: 417
Registered: ‎10-27-2010
My Device: PlayBook

Re: launching other apps

There is no mechanism right now for 3rd party to register url. We are working on that.

To launch calculator try something like

 

navigator_invoke("sys.calculator.gYABgJidBvuZ89m_1j4PV2712.A://",0);

 

(I have not tested it but theoretically it should work)

Developer
Posts: 110
Registered: ‎10-22-2011
My Device: PlayBook, Bold 9650, Dev Alpha A
My Carrier: Sprint

Re: launching other apps

Thanks for the example, elena. I hope to be able to test that very soon. :smileywink:

Should that be able to work on third-party apps, as it is a URI? Is there a way to pass args to the app? I couldn't find any navigator_invoke docs to help clarify those two questions. If both are true, it should do precisely what I am seeking. :smileyhappy:


Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Like this post too! :smileyvery-happy: