पार्टी में बहुत देर से आधिकारिक डॉक्स यहाँ हैं। और कोड वर्णित है
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(
"https://play.google.com/store/apps/details?id=com.example.android"));
intent.setPackage("com.android.vending");
startActivity(intent);
जैसे ही आप इस आशय को कॉन्फ़िगर करते हैं, पास "com.android.vending"हो जाते हैं Intent.setPackage()ताकि उपयोगकर्ता आपके ऐप के विवरण को चॉसर के बजाय Google Play Store ऐप में देखें । KOTLIN के लिए
val intent = Intent(Intent.ACTION_VIEW).apply {
data = Uri.parse(
"https://play.google.com/store/apps/details?id=com.example.android")
setPackage("com.android.vending")
}
startActivity(intent)
यदि आपने Google Play झटपट का उपयोग करके एक इंस्टेंट ऐप प्रकाशित किया है, तो आप ऐप को निम्नानुसार लॉन्च कर सकते हैं:
Intent intent = new Intent(Intent.ACTION_VIEW);
Uri.Builder uriBuilder = Uri.parse("https://play.google.com/store/apps/details")
.buildUpon()
.appendQueryParameter("id", "com.example.android")
.appendQueryParameter("launch", "true");
// Optional parameters, such as referrer, are passed onto the launched
// instant app. You can retrieve these parameters using
// Activity.getIntent().getData().
uriBuilder.appendQueryParameter("referrer", "exampleCampaignId");
intent.setData(uriBuilder.build());
intent.setPackage("com.android.vending");
startActivity(intent);
KOTLIN के लिए
val uriBuilder = Uri.parse("https://play.google.com/store/apps/details")
.buildUpon()
.appendQueryParameter("id", "com.example.android")
.appendQueryParameter("launch", "true")
// Optional parameters, such as referrer, are passed onto the launched
// instant app. You can retrieve these parameters using Activity.intent.data.
uriBuilder.appendQueryParameter("referrer", "exampleCampaignId")
val intent = Intent(Intent.ACTION_VIEW).apply {
data = uriBuilder.build()
setPackage("com.android.vending")
}
startActivity(intent)