How do I link to my Android app on device?

416 views Asked by At

I am using a url to redirect my app to facebook. One of the parameters for this is a url for redirection after the action is completed, which is where I need a link back to my app. I simply want it to go back to the app and wake it up again. Also it would be nice if this link could be used elsewhere, and would link to the play store if the application is not already installed or if it is clicked on using a desktop.

Thanks in advance, this will help me out a lot!

2

There are 2 answers

6
Sofi Software LLC On

Take a look at the App Links protocol. One implementation is in Bolts.

EDIT: A bit more info... you could use a private URL scheme (yourapp://), but there is controversy over that because schemes are supposed to be universal, and "yourapp" is not. Also, the idea of linking to the play store if the app is not installed would not work.

App links works by embedding meta data into a web page, or by standardizing the OS-specific API used to launch an app (Intents, on Android). There is a further extension implemented by Facebook called App Link Hosting, which hosts the info on FB.

0
Martin On

you can refer to any app in the play store with:

             String uri = "market://details?id=" + pkgName;

where pkgName is the name of your app's package i.e. "com.android.example" You can start an activity that way as well

         Intent intent = new Intent(Intent.ACTION_VIEW);
         String uri = "market://details?id=" + pkgName;
         intent.setData(Uri.parse(uri));
         startActivity(intent);