1

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?

3
  • 1
    I'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. Commented Feb 11, 2016 at 16:53
  • stackoverflow.com/questions/13289586/… Commented Feb 11, 2016 at 17:02
  • 1
    <a href="intent:#Intent;action=my_action;end">Link to my stuff</a> stackoverflow.com/questions/11773958/… Commented Feb 11, 2016 at 17:30

1 Answer 1

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;
    }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.