I have open the google play store using the follwing code
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
i.setData(Uri.parse("https://play.google.com/store/apps/details?id=my packagename "));
startActivity(i);.
But it shows me a Complete Action View as to select the option (browser/play store). I need to open the application in playstore directly.
Go on Android Developer official link as tutorial step by step see and got the code for your application package from play store if exists or play store apps not exists then open application from web browser.
Android Developer official link
http://developer.android.com/distribute/tools/promote/linking.html
Linking to a Applicaiton Page
From a web site:
http://play.google.com/store/apps/details?id=<package_name>
From an Android app:
market://details?id=<package_name>
Linking to a Product List
From a web site:
http://play.google.com/store/search?q=pub:<publisher_name>
From an Android app:
market://search?q=pub:<publisher_name>
Linking to a Search Result
From a web site:
http://play.google.com/store/search?q=<search_query>&c=apps
From an Android app:
market://search?q=<seach_query>&c=apps
try this
Kotlin
Ready-to-use solution:
Based on Eric's answer.
Here is the final code from the answers above that first attempts to open the app using the Google play store app and specifically play store, if it fails, it will start the action view using the web version: Credits to @Eric, @Jonathan Caballero
You can do:
get Reference here:
You can also try the approach described in the accepted answer of this question: Cannot determine whether Google play store is installed or not on Android device