2

Hi there I just finished my first app for Android that I want to publish. In my app I have a button which allows users to share the link, to my app in the Google Play Store. Now I don't know how to get that link, because my app isn't published yet. Thanks.

Raducu Mihai
  • 313
  • 4
  • 14
  • 2
    The link for your app in Google Play is like this: https://play.google.com/store/apps/details?id=#PACKAGE_NAME# – Eliran Tutia Oct 09 '16 at 12:05
  • It's fully explained in [Linking to Your Products](https://developer.android.com/distribute/tools/promote/linking.html) – Masked Man Oct 09 '16 at 12:23

2 Answers2

2

the right practice is to call the view intent by market schema using your package name like below:

String yourPackageName = getPackageName();
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + yourPackageName)));
} 
catch (android.content.ActivityNotFoundException anfe) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + yourPackageName)));
}
Amir Ziarati
  • 14,248
  • 11
  • 47
  • 52
0

You need to know the app's package name which is declared in manifest file.You can link your app -

From an Android app:-

market://details?id=<package_name>

From a web site-

http://play.google.com/store/apps/details?id=<package_name>
Gurjit Singh
  • 1,060
  • 2
  • 13
  • 16