I want to create an simple html href link on my mobile website that will open an android application like waze, whatsapp or viber. Is there any way to do this?
Asked
Active
Viewed 1,717 times
1
-
1I'm no expert in Android, but iOS, for example, uses custom url schemes for this purpose. For example, `pythonista://something` would open an app called Pythonista. – ForceBru Feb 11 '16 at 16:53
-
http://stackoverflow.com/questions/13289586/open-android-app-from-url-using-intent-filter-not-working – Daniel Nugent Feb 11 '16 at 17:02
-
1Link to my stuff http://stackoverflow.com/questions/11773958/open-android-application-from-a-web-page – sejo Feb 11 '16 at 17:30
1 Answers
0
For start Vkontakte application and open profile page I used:
if (isVKAppInstalled(context)) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format("vkontakte://profile/%d", vkUserId)));
context.startActivity(intent);
}
And method for check if app installed:
public static boolean isVKAppInstalled(Context context) {
PackageManager pm = context.getPackageManager();
boolean isInstalled;
try {
pm.getPackageInfo(VK_PACKAGE_URI, PackageManager.GET_ACTIVITIES);
isInstalled = true;
} catch (PackageManager.NameNotFoundException e) {
isInstalled = false;
}
return isInstalled;
}

Ihor Monochkov
- 11
- 3