Reputation: 59
I would to know how can I insert a link on my google app that leads to the google play store showing the application itself.
Let me explain, I still have not posted my application yet and do not have a valid link for the google play, but if I wanted to put in my app a link that leads to market my app how do I do it not having yet published?
Upvotes: 0
Views: 266
Reputation: 421
Try this function .. Hope it helps :)
private void launchMarket() {
Uri uri = Uri.parse("market://details?id=" + getPackageName());
Intent myAppLinkToMarket = new Intent(Intent.ACTION_VIEW, uri);
try {
startActivity(myAppLinkToMarket);
} catch (ActivityNotFoundException e) {
Toast.makeText(this, " unable to find market app", Toast.LENGTH_LONG).show();
}
}
Upvotes: 3
Reputation: 47945
You can link to the Google Play website https://play.google.com/store/apps/details?id=your.package.name
or you can use the maket schema: market://search?q=your.package.name
.
The last one will open the PlayStore in every case (unless you have installed some malicious apps).
Upvotes: 1