How do you link directly to another app to open it (the actual app and not the marketplace or appstore reference)? What's the format for both Android and iOS?
Asked
Active
Viewed 3,622 times
0
-
If by link you mean install you can have a look at this [thread](http://stackoverflow.com/questions/4552428/install-apk-with-intent-action-view-is-downloading-but-not-installing-the-file) – Carl-Emil Kjellstrand Mar 25 '12 at 12:04
-
I don't mean install... i mean open – ina Mar 25 '12 at 12:06
-
2This should be two different questions: one for Android and one for iOS. – Richard Szalay Mar 25 '12 at 12:31
-
I guess I might have been simplifying the problem.. I had thought there was a universal protocol such as app://com.packagenanme.appname (?) – ina Mar 25 '12 at 13:23
4 Answers
0
On android, just create an Intent
Intent intent = new Intent(APP_PACKAGE);
startActivity(intent);

Alix Bloom
- 217
- 1
- 8
-
No... I'm not trying to start a new activity - just trying to open another app – ina Mar 25 '12 at 12:07
-
1@ina: You start another app by opening one of its activities, just as you start another Web app by loading one of its Web pages. That being said, this answer's first line of code is wrong -- you do not create an `Intent` pretending that the app's package is somehow an action string. You need to determine the appropriate `Intent` to use for the app you want to open. That might be by reading the developer docs for that app. Or, you can use `PackageManager` to find a suitable `Intent` for launching the "main" activity in an app via its package. – CommonsWare Mar 25 '12 at 12:18
-
hmmm there's nothing like a universal format like this: android://com.packagename.appname ?? – ina Mar 25 '12 at 13:23
0
Ok, then you might want to look at Open another application from your own (intent) And you might want to search before you ask :D Quicker way for you to find answers most of the time:)

Community
- 1
- 1

Carl-Emil Kjellstrand
- 1,233
- 1
- 10
- 17
-
unless you don't know that you should search for intent of-course, so your are probably quite right about asking :) Couldn't find any good answer unless i included that in my search :D – Carl-Emil Kjellstrand Mar 25 '12 at 12:10
0
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:yourAppURL];
for example mail app in iPhone:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://info@iphonedevelopertips.com"]];
link to tutorial: Launching Your Own Application via a Custom URL Scheme

Michal Zaborowski
- 5,039
- 36
- 35
-
And if you want to create your own URLs for your own applications, take a look at this method: [- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation] Here you will find its reference: http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html – Ricard Pérez del Campo Mar 25 '12 at 12:20
-
check my link: Launching Your Own Application via a Custom URL Scheme – Michal Zaborowski Mar 25 '12 at 12:20
-
is the only way to launch the app via a custom url scheme? what if the app you want to launch does not have the scheme setup? is there a way to launch it? – ina Mar 25 '12 at 13:24
-
0
Not sure how you would go about on th iOS side of things, but for the Android part, refer to this link: Open another application from your own (intent)
The OP had a similar question and the solution worked for him. Give it a look.

Community
- 1
- 1

Siddharth Lele
- 27,623
- 15
- 98
- 151
-
My bad. I did not realize @erbsman had posted the same link earlier than I did. Mighty sorry fella. – Siddharth Lele Mar 25 '12 at 12:50