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?
1 Answer
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;
}
pythonista://somethingwould open an app called Pythonista.