I'm new to both Android and Native Script. How do I open the Google Play Store inside my android app using Native Script. I've tried using web view and it works fine but I would like to open the Google Play Store using the Google Play Store app in the device.
Asked
Active
Viewed 670 times
2
-
So far I've tried using web view and passing URL for Google Play Store. Just a simple webview with the URL of Google Play Store as source. Also, I ave used this link for reference, http://stackoverflow.com/questions/11753000/how-to-open-the-google-play-store-directly-from-my-android-application but most of it are not supported by Native Script and lack documentations for it. – Jan Michael Mar 29 '16 at 03:04
-
It may help to add some details of what you've tried to the original question. You can edit the question and add more whenever you need to. – Tim Ogilvy Mar 29 '16 at 03:05
1 Answers
-1
Add permission application
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Add code into oncreate method
String url = "https://play.google.com/store/apps";
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
startActivity(intent);

Muhammad Waleed
- 2,517
- 4
- 27
- 75