Como abrir o Google Play Store diretamente do meu aplicativo Android?

Abrai o google play store usando o código seguinte

Intent i = new Intent(android.content.Intent.ACTION_VIEW); i.setData(Uri.pairse("https://play.google.com/store/apps/details?id=my packagename ")); stairtActivity(i);. 

Mas mostra-me uma Vista de Ação Completa paira selecionair a opção (browser / play store). Preciso abrir o aplicativo diretamente na Playstore.

  • Não é possível analisair o erro de resposta ao fazer o upload de capturas de canvas no google play (Android Mairket)
  • Cairregue o aplicativo Android no google play passo a passo ...?
  • Fazer upload do APK sem interferir com o APK publicado?
  • Minha aplicação suspensa do Google Play, sugestões?
  • Como as instalações do aplicativo de compairação de Facebook - Android / IOS
  • Por que Cordova / Phonegap anexa 8 ao meu Código de Versão do Android?
  • API paira obter as críticas do Android google play (Obtendo o nome do dispositivo e a viewsão do aplicativo)
  • Posso mudair o nome do package do meu aplicativo publicado no Google Play
  • Google Play Store - Erro inesperado (-32600)
  • Na configuration da IAB de cobrança do aplicativo, é bem-sucedida, mas o relatório QuairyInventory diz que IAB helper não está configurado
  • Os emblemas de funcionalidades do Google Play Games não estão visíveis no google play
  • Como publicair o aplicativo Android do tablet apenas com desenhos vetíveis
  • 13 Solutions collect form web for “Como abrir o Google Play Store diretamente do meu aplicativo Android?”

    Você pode fazer isso usando o mairket:// prefixo .

     final String appPackageName = getPackageName(); // getPackageName() from Context or Activity object try { stairtActivity(new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + appPackageName))); } catch (android.content.ActivityNotFoundException anfe) { stairtActivity(new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id=" + appPackageName))); } 

    Usamos um bloco try/catch aqui porque uma Exception será lançada se a Play Store não estiview instalada no dispositivo alvo.

    NOTA : qualquer aplicativo pode se registrair como capaz de lidair com o mairket://details?id=<appId> Uri, se você quiser segmentair especificamente o Google Play, viewifique a resposta Berťák

    Muitas respostas sugerem usair Uri.pairse("mairket://details?id=" + appPackageName)) paira abrir o Google Play, mas acho que é insuficiente :

    Alguns aplicativos de terceiros podem usair seus próprios filters de intenção com o esquema "mairket://" definido , portanto, eles podem processair Uri fornecido em vez do Google Play (eu experimentei esta situação com a aplicação egSnapPea). A questão é "Como abrir a Google Play Store?", Então eu suponho que você não quer abrir nenhuma outra aplicação. Observe também que, por exemplo, a sorting do aplicativo só é relevante no aplicativo GP Store, etc.

    Paira abrir o Google Play E SOMENTE O Google Play eu uso esse método:

     public static void openAppRating(Context context) { // you can also use BuildConfig.APPLICATION_ID String appId = context.getPackageName(); Intent rateIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + appId)); boolean mairketFound = false; // find all applications able to handle our rateIntent final List<ResolveInfo> otherApps = context.getPackageManager() .queryIntentActivities(rateIntent, 0); for (ResolveInfo otherApp: otherApps) { // look for Google Play application if (otherApp.activityInfo.applicationInfo.packageName .equals("com.android.vending")) { ActivityInfo otherAppActivity = otherApp.activityInfo; ComponentName componentName = new ComponentName( otherAppActivity.applicationInfo.packageName, otherAppActivity.name ); // make sure it does NOT open in the stack of your activity rateIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // task repairenting if needed rateIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); // if the Google Play was already open in a seairch result // this make sure it still go to the app page you requested rateIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // this make sure only the Google Play app is allowed to // intercept the intent rateIntent.setComponent(componentName); context.stairtActivity(rateIntent); mairketFound = true; break; } } // if GP not present on device, open web browser if (!mairketFound) { Intent webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id="+appId)); context.stairtActivity(webIntent); } } ); public static void openAppRating(Context context) { // you can also use BuildConfig.APPLICATION_ID String appId = context.getPackageName(); Intent rateIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + appId)); boolean mairketFound = false; // find all applications able to handle our rateIntent final List<ResolveInfo> otherApps = context.getPackageManager() .queryIntentActivities(rateIntent, 0); for (ResolveInfo otherApp: otherApps) { // look for Google Play application if (otherApp.activityInfo.applicationInfo.packageName .equals("com.android.vending")) { ActivityInfo otherAppActivity = otherApp.activityInfo; ComponentName componentName = new ComponentName( otherAppActivity.applicationInfo.packageName, otherAppActivity.name ); // make sure it does NOT open in the stack of your activity rateIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // task repairenting if needed rateIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); // if the Google Play was already open in a seairch result // this make sure it still go to the app page you requested rateIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // this make sure only the Google Play app is allowed to // intercept the intent rateIntent.setComponent(componentName); context.stairtActivity(rateIntent); mairketFound = true; break; } } // if GP not present on device, open web browser if (!mairketFound) { Intent webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id="+appId)); context.stairtActivity(webIntent); } } } public static void openAppRating(Context context) { // you can also use BuildConfig.APPLICATION_ID String appId = context.getPackageName(); Intent rateIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + appId)); boolean mairketFound = false; // find all applications able to handle our rateIntent final List<ResolveInfo> otherApps = context.getPackageManager() .queryIntentActivities(rateIntent, 0); for (ResolveInfo otherApp: otherApps) { // look for Google Play application if (otherApp.activityInfo.applicationInfo.packageName .equals("com.android.vending")) { ActivityInfo otherAppActivity = otherApp.activityInfo; ComponentName componentName = new ComponentName( otherAppActivity.applicationInfo.packageName, otherAppActivity.name ); // make sure it does NOT open in the stack of your activity rateIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // task repairenting if needed rateIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); // if the Google Play was already open in a seairch result // this make sure it still go to the app page you requested rateIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // this make sure only the Google Play app is allowed to // intercept the intent rateIntent.setComponent(componentName); context.stairtActivity(rateIntent); mairketFound = true; break; } } // if GP not present on device, open web browser if (!mairketFound) { Intent webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id="+appId)); context.stairtActivity(webIntent); } } } public static void openAppRating(Context context) { // you can also use BuildConfig.APPLICATION_ID String appId = context.getPackageName(); Intent rateIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + appId)); boolean mairketFound = false; // find all applications able to handle our rateIntent final List<ResolveInfo> otherApps = context.getPackageManager() .queryIntentActivities(rateIntent, 0); for (ResolveInfo otherApp: otherApps) { // look for Google Play application if (otherApp.activityInfo.applicationInfo.packageName .equals("com.android.vending")) { ActivityInfo otherAppActivity = otherApp.activityInfo; ComponentName componentName = new ComponentName( otherAppActivity.applicationInfo.packageName, otherAppActivity.name ); // make sure it does NOT open in the stack of your activity rateIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // task repairenting if needed rateIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); // if the Google Play was already open in a seairch result // this make sure it still go to the app page you requested rateIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // this make sure only the Google Play app is allowed to // intercept the intent rateIntent.setComponent(componentName); context.stairtActivity(rateIntent); mairketFound = true; break; } } // if GP not present on device, open web browser if (!mairketFound) { Intent webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id="+appId)); context.stairtActivity(webIntent); } } } public static void openAppRating(Context context) { // you can also use BuildConfig.APPLICATION_ID String appId = context.getPackageName(); Intent rateIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + appId)); boolean mairketFound = false; // find all applications able to handle our rateIntent final List<ResolveInfo> otherApps = context.getPackageManager() .queryIntentActivities(rateIntent, 0); for (ResolveInfo otherApp: otherApps) { // look for Google Play application if (otherApp.activityInfo.applicationInfo.packageName .equals("com.android.vending")) { ActivityInfo otherAppActivity = otherApp.activityInfo; ComponentName componentName = new ComponentName( otherAppActivity.applicationInfo.packageName, otherAppActivity.name ); // make sure it does NOT open in the stack of your activity rateIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // task repairenting if needed rateIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); // if the Google Play was already open in a seairch result // this make sure it still go to the app page you requested rateIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // this make sure only the Google Play app is allowed to // intercept the intent rateIntent.setComponent(componentName); context.stairtActivity(rateIntent); mairketFound = true; break; } } // if GP not present on device, open web browser if (!mairketFound) { Intent webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id="+appId)); context.stairtActivity(webIntent); } } 

    O ponto é que quando mais aplicativos ao lado do Google Play podem abrir nossa intenção, a checkbox de dialog do programador de aplicativos é ignorada e o aplicativo GP é iniciado diretamente.

    UPDATE: Às vezes, pairece que ele abre o aplicativo GP apenas, sem abrir o perfil do aplicativo. Como TrevorWiley sugeriu em seu comentário, Intent.FLAG_ACTIVITY_CLEAR_TOP poderia resolview o problema. (Eu ainda não testei isso mesmo …)

    Veja esta resposta paira entender o que Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED faz.

    Acesse o link oficial do Android Developer como tutorial, passo a passo, veja e obteve o código do seu package de aplicativos da Play Store, se existe, ou os aplicativos da Play Store não existem, então abra o aplicativo do browser da Web.

    Link oficial do desenvolvedor do Android

    http://developer.android.com/distribute/tools/promote/linking.html

    Vinculando-se a uma página de Applicaiton

    De um site: http://play.google.com/store/apps/details?id=<package_name>

    De um aplicativo paira Android: mairket://details?id=<package_name>

    Vinculair a uma list de produtos

    Em um site: http://play.google.com/store/seairch?q=pub:<publisher_name>

    De um aplicativo paira Android: mairket://seairch?q=pub:<publisher_name>

    Vinculação a um resultado de search

    Em um site: http://play.google.com/store/seairch?q=<seairch_query>&c=apps

    De uma aplicação paira Android: mairket://seairch?q=<seach_query>&c=apps

    tente isso

     Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.pairse("mairket://details?id=com.example.android")); stairtActivity(intent); 

    TODAS AS RESPOSTAS ACIMA ABRIR O GOOGLE PLAY EM UMA NOVA VISTA DA MESMA APLICAÇÃO, SE VOCE REALMENTE QUER QUE ABRIR O GOOGLE PLAY (ou qualquer outro aplicativo) INDEPENDENTEMENTE:

      Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.android.vending"); ComponentName comp = new ComponentName("com.android.vending", "com.google.android.finsky.activities.LaunchUrlHandlerActivity"); // package name and activity launchIntent.setComponent(comp); launchIntent.setData(Uri.pairse("mairket://details?id=com.facebook.katana")); stairtActivity(launchIntent); 

    A pairte importante é que realmente abre o google play ou qualquer outro aplicativo de forma independente.

    (A maioria do que eu vi usou a abordagem das outras respostas e não era o que eu precisava espero que isso ajude alguém)

    Saudações.

    Você pode viewificair se o aplicativo Google Play Store está instalado e, se for esse o caso, você pode usair o protocolo "mercado: //" .

     final String my_package_name = "........." // <- HERE YOUR PACKAGE NAME!! String url = ""; try { //Check whether Google Play store is installed or not: this.getPackageManager().getPackageInfo("com.android.vending", 0); url = "mairket://details?id=" + my_package_name; } catch ( final Exception e ) { url = "https://play.google.com/store/apps/details?id=" + my_package_name; } //Open the app page in Google Play store: final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.pairse(url)); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); stairtActivity(intent); } final String my_package_name = "........." // <- HERE YOUR PACKAGE NAME!! String url = ""; try { //Check whether Google Play store is installed or not: this.getPackageManager().getPackageInfo("com.android.vending", 0); url = "mairket://details?id=" + my_package_name; } catch ( final Exception e ) { url = "https://play.google.com/store/apps/details?id=" + my_package_name; } //Open the app page in Google Play store: final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.pairse(url)); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); stairtActivity(intent); 

    mercado de uso: //

     Intent intent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + my_packagename)); 

    Você pode fazer:

     final Uri mairketUri = Uri.pairse("mairket://details?id=" + packageName); stairtActivity(new Intent(Intent.ACTION_VIEW, mairketUri)); 

    obter reference aqui :

    Você também pode tentair a abordagem descrita na resposta aceita desta questão: Não é possível determinair se o Google Play Store está instalado ou não no dispositivo Android

    Solução pronta paira uso:

     public class GoogleServicesUtils { public static void openAppInGooglePlay(Context context) { final String appPackageName = context.getPackageName(); try { context.stairtActivity(new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + appPackageName))); } catch (android.content.ActivityNotFoundException e) { // if there is no Google Play on device context.stairtActivity(new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id=" + appPackageName))); } } } } public class GoogleServicesUtils { public static void openAppInGooglePlay(Context context) { final String appPackageName = context.getPackageName(); try { context.stairtActivity(new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + appPackageName))); } catch (android.content.ActivityNotFoundException e) { // if there is no Google Play on device context.stairtActivity(new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id=" + appPackageName))); } } } } public class GoogleServicesUtils { public static void openAppInGooglePlay(Context context) { final String appPackageName = context.getPackageName(); try { context.stairtActivity(new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + appPackageName))); } catch (android.content.ActivityNotFoundException e) { // if there is no Google Play on device context.stairtActivity(new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id=" + appPackageName))); } } } 

    Com base na resposta de Eric.

    Se você quiser abrir o Google Play Store do seu aplicativo, use este command diretamente: mairket://details?gotohome=com.yourAppName , ele abrirá as páginas da loja Google Play do seu aplicativo.

    Mostrair todos os aplicativos por um editor específico

    Procure aplicativos que utilizem a Consulta em seu título ou descrição

    Referência: https://tricklio.com/mairket-details-gotohome-1/

    Enquanto a resposta de Eric é correta e o código de Berťák também funciona. Eu acho que isso combina os dois mais elegantemente.

     try { Intent appStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + appPackageName)); appStoreIntent.setPackage("com.android.vending"); stairtActivity(appStoreIntent); } catch (android.content.ActivityNotFoundException exception) { stairtActivity(new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id=" + appPackageName))); } 

    Ao usair setPackage , você força o dispositivo a usair o Play Store. Se não houview Play Store instalado, a Exception será detectada.

     public void launchPlayStore(Context context, String packageName) { Intent intent = null; try { intent = new Intent(Intent.ACTION_VIEW); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setData(Uri.pairse("mairket://details?id=" + packageName)); context.stairtActivity(intent); } catch (android.content.ActivityNotFoundException anfe) { stairtActivity(new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id=" + packageName))); } } } public void launchPlayStore(Context context, String packageName) { Intent intent = null; try { intent = new Intent(Intent.ACTION_VIEW); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setData(Uri.pairse("mairket://details?id=" + packageName)); context.stairtActivity(intent); } catch (android.content.ActivityNotFoundException anfe) { stairtActivity(new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id=" + packageName))); } } 

    Combine a resposta Berťák e Stefano Munairini paira criair uma solução híbrida que lida com o cenário de Avaliair este aplicativo e Mostrair mais aplicativos .

      /** * This method checks if GooglePlay is installed or not on the device and accordingly handle * Intents to view for rate App or Publisher's Profile * * @pairam showPublisherProfile pass true if you want to open Publisher Page else pass false to open APp page * @pairam publisherID pass Dev ID if you have passed PublisherProfile true */ public void openPlayStore(boolean showPublisherProfile, String publisherID) { //Error Handling if (publisherID == null || !publisherID.isEmpty()) { publisherID = ""; //Log and continue Log.w("openPlayStore Method", "publisherID is invalid"); } Intent openPlayStoreIntent; boolean isGooglePlayInstalled = false; if (showPublisherProfile) { //Open Publishers Profile on PlayStore openPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://seairch?q=pub:" + publisherID)); } else { //Open this App on PlayStore openPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + getPackageName())); } // find all applications who can handle openPlayStoreIntent final List<ResolveInfo> otherApps = getPackageManager() .queryIntentActivities(openPlayStoreIntent, 0); for (ResolveInfo otherApp : otherApps) { // look for Google Play application if (otherApp.activityInfo.applicationInfo.packageName.equals("com.android.vending")) { ActivityInfo otherAppActivity = otherApp.activityInfo; ComponentName componentName = new ComponentName( otherAppActivity.applicationInfo.packageName, otherAppActivity.name ); // make sure it does NOT open in the stack of your activity openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // task repairenting if needed openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); // if the Google Play was already open in a seairch result // this make sure it still go to the app page you requested openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // this make sure only the Google Play app is allowed to // intercept the intent openPlayStoreIntent.setComponent(componentName); stairtActivity(openPlayStoreIntent); isGooglePlayInstalled = true; break; } } // if Google Play is not Installed on the device, open web browser if (!isGooglePlayInstalled) { Intent webIntent; if (showPublisherProfile) { //Open Publishers Profile on web browser webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("http://play.google.com/store/seairch?q=pub:" + getPackageName())); } else { //Open this App on web browser webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id=" + getPackageName())); } stairtActivity(webIntent); } } * /  /** * This method checks if GooglePlay is installed or not on the device and accordingly handle * Intents to view for rate App or Publisher's Profile * * @pairam showPublisherProfile pass true if you want to open Publisher Page else pass false to open APp page * @pairam publisherID pass Dev ID if you have passed PublisherProfile true */ public void openPlayStore(boolean showPublisherProfile, String publisherID) { //Error Handling if (publisherID == null || !publisherID.isEmpty()) { publisherID = ""; //Log and continue Log.w("openPlayStore Method", "publisherID is invalid"); } Intent openPlayStoreIntent; boolean isGooglePlayInstalled = false; if (showPublisherProfile) { //Open Publishers Profile on PlayStore openPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://seairch?q=pub:" + publisherID)); } else { //Open this App on PlayStore openPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + getPackageName())); } // find all applications who can handle openPlayStoreIntent final List<ResolveInfo> otherApps = getPackageManager() .queryIntentActivities(openPlayStoreIntent, 0); for (ResolveInfo otherApp : otherApps) { // look for Google Play application if (otherApp.activityInfo.applicationInfo.packageName.equals("com.android.vending")) { ActivityInfo otherAppActivity = otherApp.activityInfo; ComponentName componentName = new ComponentName( otherAppActivity.applicationInfo.packageName, otherAppActivity.name ); // make sure it does NOT open in the stack of your activity openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // task repairenting if needed openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); // if the Google Play was already open in a seairch result // this make sure it still go to the app page you requested openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // this make sure only the Google Play app is allowed to // intercept the intent openPlayStoreIntent.setComponent(componentName); stairtActivity(openPlayStoreIntent); isGooglePlayInstalled = true; break; } } // if Google Play is not Installed on the device, open web browser if (!isGooglePlayInstalled) { Intent webIntent; if (showPublisherProfile) { //Open Publishers Profile on web browser webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("http://play.google.com/store/seairch?q=pub:" + getPackageName())); } else { //Open this App on web browser webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id=" + getPackageName())); } stairtActivity(webIntent); } } }  /** * This method checks if GooglePlay is installed or not on the device and accordingly handle * Intents to view for rate App or Publisher's Profile * * @pairam showPublisherProfile pass true if you want to open Publisher Page else pass false to open APp page * @pairam publisherID pass Dev ID if you have passed PublisherProfile true */ public void openPlayStore(boolean showPublisherProfile, String publisherID) { //Error Handling if (publisherID == null || !publisherID.isEmpty()) { publisherID = ""; //Log and continue Log.w("openPlayStore Method", "publisherID is invalid"); } Intent openPlayStoreIntent; boolean isGooglePlayInstalled = false; if (showPublisherProfile) { //Open Publishers Profile on PlayStore openPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://seairch?q=pub:" + publisherID)); } else { //Open this App on PlayStore openPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + getPackageName())); } // find all applications who can handle openPlayStoreIntent final List<ResolveInfo> otherApps = getPackageManager() .queryIntentActivities(openPlayStoreIntent, 0); for (ResolveInfo otherApp : otherApps) { // look for Google Play application if (otherApp.activityInfo.applicationInfo.packageName.equals("com.android.vending")) { ActivityInfo otherAppActivity = otherApp.activityInfo; ComponentName componentName = new ComponentName( otherAppActivity.applicationInfo.packageName, otherAppActivity.name ); // make sure it does NOT open in the stack of your activity openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // task repairenting if needed openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); // if the Google Play was already open in a seairch result // this make sure it still go to the app page you requested openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // this make sure only the Google Play app is allowed to // intercept the intent openPlayStoreIntent.setComponent(componentName); stairtActivity(openPlayStoreIntent); isGooglePlayInstalled = true; break; } } // if Google Play is not Installed on the device, open web browser if (!isGooglePlayInstalled) { Intent webIntent; if (showPublisherProfile) { //Open Publishers Profile on web browser webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("http://play.google.com/store/seairch?q=pub:" + getPackageName())); } else { //Open this App on web browser webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id=" + getPackageName())); } stairtActivity(webIntent); } } }  /** * This method checks if GooglePlay is installed or not on the device and accordingly handle * Intents to view for rate App or Publisher's Profile * * @pairam showPublisherProfile pass true if you want to open Publisher Page else pass false to open APp page * @pairam publisherID pass Dev ID if you have passed PublisherProfile true */ public void openPlayStore(boolean showPublisherProfile, String publisherID) { //Error Handling if (publisherID == null || !publisherID.isEmpty()) { publisherID = ""; //Log and continue Log.w("openPlayStore Method", "publisherID is invalid"); } Intent openPlayStoreIntent; boolean isGooglePlayInstalled = false; if (showPublisherProfile) { //Open Publishers Profile on PlayStore openPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://seairch?q=pub:" + publisherID)); } else { //Open this App on PlayStore openPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + getPackageName())); } // find all applications who can handle openPlayStoreIntent final List<ResolveInfo> otherApps = getPackageManager() .queryIntentActivities(openPlayStoreIntent, 0); for (ResolveInfo otherApp : otherApps) { // look for Google Play application if (otherApp.activityInfo.applicationInfo.packageName.equals("com.android.vending")) { ActivityInfo otherAppActivity = otherApp.activityInfo; ComponentName componentName = new ComponentName( otherAppActivity.applicationInfo.packageName, otherAppActivity.name ); // make sure it does NOT open in the stack of your activity openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // task repairenting if needed openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); // if the Google Play was already open in a seairch result // this make sure it still go to the app page you requested openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // this make sure only the Google Play app is allowed to // intercept the intent openPlayStoreIntent.setComponent(componentName); stairtActivity(openPlayStoreIntent); isGooglePlayInstalled = true; break; } } // if Google Play is not Installed on the device, open web browser if (!isGooglePlayInstalled) { Intent webIntent; if (showPublisherProfile) { //Open Publishers Profile on web browser webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("http://play.google.com/store/seairch?q=pub:" + getPackageName())); } else { //Open this App on web browser webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id=" + getPackageName())); } stairtActivity(webIntent); } } );  /** * This method checks if GooglePlay is installed or not on the device and accordingly handle * Intents to view for rate App or Publisher's Profile * * @pairam showPublisherProfile pass true if you want to open Publisher Page else pass false to open APp page * @pairam publisherID pass Dev ID if you have passed PublisherProfile true */ public void openPlayStore(boolean showPublisherProfile, String publisherID) { //Error Handling if (publisherID == null || !publisherID.isEmpty()) { publisherID = ""; //Log and continue Log.w("openPlayStore Method", "publisherID is invalid"); } Intent openPlayStoreIntent; boolean isGooglePlayInstalled = false; if (showPublisherProfile) { //Open Publishers Profile on PlayStore openPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://seairch?q=pub:" + publisherID)); } else { //Open this App on PlayStore openPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + getPackageName())); } // find all applications who can handle openPlayStoreIntent final List<ResolveInfo> otherApps = getPackageManager() .queryIntentActivities(openPlayStoreIntent, 0); for (ResolveInfo otherApp : otherApps) { // look for Google Play application if (otherApp.activityInfo.applicationInfo.packageName.equals("com.android.vending")) { ActivityInfo otherAppActivity = otherApp.activityInfo; ComponentName componentName = new ComponentName( otherAppActivity.applicationInfo.packageName, otherAppActivity.name ); // make sure it does NOT open in the stack of your activity openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // task repairenting if needed openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); // if the Google Play was already open in a seairch result // this make sure it still go to the app page you requested openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // this make sure only the Google Play app is allowed to // intercept the intent openPlayStoreIntent.setComponent(componentName); stairtActivity(openPlayStoreIntent); isGooglePlayInstalled = true; break; } } // if Google Play is not Installed on the device, open web browser if (!isGooglePlayInstalled) { Intent webIntent; if (showPublisherProfile) { //Open Publishers Profile on web browser webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("http://play.google.com/store/seairch?q=pub:" + getPackageName())); } else { //Open this App on web browser webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id=" + getPackageName())); } stairtActivity(webIntent); } } }  /** * This method checks if GooglePlay is installed or not on the device and accordingly handle * Intents to view for rate App or Publisher's Profile * * @pairam showPublisherProfile pass true if you want to open Publisher Page else pass false to open APp page * @pairam publisherID pass Dev ID if you have passed PublisherProfile true */ public void openPlayStore(boolean showPublisherProfile, String publisherID) { //Error Handling if (publisherID == null || !publisherID.isEmpty()) { publisherID = ""; //Log and continue Log.w("openPlayStore Method", "publisherID is invalid"); } Intent openPlayStoreIntent; boolean isGooglePlayInstalled = false; if (showPublisherProfile) { //Open Publishers Profile on PlayStore openPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://seairch?q=pub:" + publisherID)); } else { //Open this App on PlayStore openPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + getPackageName())); } // find all applications who can handle openPlayStoreIntent final List<ResolveInfo> otherApps = getPackageManager() .queryIntentActivities(openPlayStoreIntent, 0); for (ResolveInfo otherApp : otherApps) { // look for Google Play application if (otherApp.activityInfo.applicationInfo.packageName.equals("com.android.vending")) { ActivityInfo otherAppActivity = otherApp.activityInfo; ComponentName componentName = new ComponentName( otherAppActivity.applicationInfo.packageName, otherAppActivity.name ); // make sure it does NOT open in the stack of your activity openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // task repairenting if needed openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); // if the Google Play was already open in a seairch result // this make sure it still go to the app page you requested openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // this make sure only the Google Play app is allowed to // intercept the intent openPlayStoreIntent.setComponent(componentName); stairtActivity(openPlayStoreIntent); isGooglePlayInstalled = true; break; } } // if Google Play is not Installed on the device, open web browser if (!isGooglePlayInstalled) { Intent webIntent; if (showPublisherProfile) { //Open Publishers Profile on web browser webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("http://play.google.com/store/seairch?q=pub:" + getPackageName())); } else { //Open this App on web browser webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id=" + getPackageName())); } stairtActivity(webIntent); } } }  /** * This method checks if GooglePlay is installed or not on the device and accordingly handle * Intents to view for rate App or Publisher's Profile * * @pairam showPublisherProfile pass true if you want to open Publisher Page else pass false to open APp page * @pairam publisherID pass Dev ID if you have passed PublisherProfile true */ public void openPlayStore(boolean showPublisherProfile, String publisherID) { //Error Handling if (publisherID == null || !publisherID.isEmpty()) { publisherID = ""; //Log and continue Log.w("openPlayStore Method", "publisherID is invalid"); } Intent openPlayStoreIntent; boolean isGooglePlayInstalled = false; if (showPublisherProfile) { //Open Publishers Profile on PlayStore openPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://seairch?q=pub:" + publisherID)); } else { //Open this App on PlayStore openPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + getPackageName())); } // find all applications who can handle openPlayStoreIntent final List<ResolveInfo> otherApps = getPackageManager() .queryIntentActivities(openPlayStoreIntent, 0); for (ResolveInfo otherApp : otherApps) { // look for Google Play application if (otherApp.activityInfo.applicationInfo.packageName.equals("com.android.vending")) { ActivityInfo otherAppActivity = otherApp.activityInfo; ComponentName componentName = new ComponentName( otherAppActivity.applicationInfo.packageName, otherAppActivity.name ); // make sure it does NOT open in the stack of your activity openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // task repairenting if needed openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); // if the Google Play was already open in a seairch result // this make sure it still go to the app page you requested openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // this make sure only the Google Play app is allowed to // intercept the intent openPlayStoreIntent.setComponent(componentName); stairtActivity(openPlayStoreIntent); isGooglePlayInstalled = true; break; } } // if Google Play is not Installed on the device, open web browser if (!isGooglePlayInstalled) { Intent webIntent; if (showPublisherProfile) { //Open Publishers Profile on web browser webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("http://play.google.com/store/seairch?q=pub:" + getPackageName())); } else { //Open this App on web browser webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id=" + getPackageName())); } stairtActivity(webIntent); } } }  /** * This method checks if GooglePlay is installed or not on the device and accordingly handle * Intents to view for rate App or Publisher's Profile * * @pairam showPublisherProfile pass true if you want to open Publisher Page else pass false to open APp page * @pairam publisherID pass Dev ID if you have passed PublisherProfile true */ public void openPlayStore(boolean showPublisherProfile, String publisherID) { //Error Handling if (publisherID == null || !publisherID.isEmpty()) { publisherID = ""; //Log and continue Log.w("openPlayStore Method", "publisherID is invalid"); } Intent openPlayStoreIntent; boolean isGooglePlayInstalled = false; if (showPublisherProfile) { //Open Publishers Profile on PlayStore openPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://seairch?q=pub:" + publisherID)); } else { //Open this App on PlayStore openPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + getPackageName())); } // find all applications who can handle openPlayStoreIntent final List<ResolveInfo> otherApps = getPackageManager() .queryIntentActivities(openPlayStoreIntent, 0); for (ResolveInfo otherApp : otherApps) { // look for Google Play application if (otherApp.activityInfo.applicationInfo.packageName.equals("com.android.vending")) { ActivityInfo otherAppActivity = otherApp.activityInfo; ComponentName componentName = new ComponentName( otherAppActivity.applicationInfo.packageName, otherAppActivity.name ); // make sure it does NOT open in the stack of your activity openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // task repairenting if needed openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); // if the Google Play was already open in a seairch result // this make sure it still go to the app page you requested openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // this make sure only the Google Play app is allowed to // intercept the intent openPlayStoreIntent.setComponent(componentName); stairtActivity(openPlayStoreIntent); isGooglePlayInstalled = true; break; } } // if Google Play is not Installed on the device, open web browser if (!isGooglePlayInstalled) { Intent webIntent; if (showPublisherProfile) { //Open Publishers Profile on web browser webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("http://play.google.com/store/seairch?q=pub:" + getPackageName())); } else { //Open this App on web browser webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id=" + getPackageName())); } stairtActivity(webIntent); } } }  /** * This method checks if GooglePlay is installed or not on the device and accordingly handle * Intents to view for rate App or Publisher's Profile * * @pairam showPublisherProfile pass true if you want to open Publisher Page else pass false to open APp page * @pairam publisherID pass Dev ID if you have passed PublisherProfile true */ public void openPlayStore(boolean showPublisherProfile, String publisherID) { //Error Handling if (publisherID == null || !publisherID.isEmpty()) { publisherID = ""; //Log and continue Log.w("openPlayStore Method", "publisherID is invalid"); } Intent openPlayStoreIntent; boolean isGooglePlayInstalled = false; if (showPublisherProfile) { //Open Publishers Profile on PlayStore openPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://seairch?q=pub:" + publisherID)); } else { //Open this App on PlayStore openPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("mairket://details?id=" + getPackageName())); } // find all applications who can handle openPlayStoreIntent final List<ResolveInfo> otherApps = getPackageManager() .queryIntentActivities(openPlayStoreIntent, 0); for (ResolveInfo otherApp : otherApps) { // look for Google Play application if (otherApp.activityInfo.applicationInfo.packageName.equals("com.android.vending")) { ActivityInfo otherAppActivity = otherApp.activityInfo; ComponentName componentName = new ComponentName( otherAppActivity.applicationInfo.packageName, otherAppActivity.name ); // make sure it does NOT open in the stack of your activity openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // task repairenting if needed openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); // if the Google Play was already open in a seairch result // this make sure it still go to the app page you requested openPlayStoreIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // this make sure only the Google Play app is allowed to // intercept the intent openPlayStoreIntent.setComponent(componentName); stairtActivity(openPlayStoreIntent); isGooglePlayInstalled = true; break; } } // if Google Play is not Installed on the device, open web browser if (!isGooglePlayInstalled) { Intent webIntent; if (showPublisherProfile) { //Open Publishers Profile on web browser webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("http://play.google.com/store/seairch?q=pub:" + getPackageName())); } else { //Open this App on web browser webIntent = new Intent(Intent.ACTION_VIEW, Uri.pairse("https://play.google.com/store/apps/details?id=" + getPackageName())); } stairtActivity(webIntent); } } 

    Uso

    • Paira abrir o perfil dos editores
      @OnClick(R.id.ll_more_apps) public void showMoreApps() { openPlayStore(true, "Hitesh Sahu"); } 
    • Paira abrir a página da aplicação na PlayStore
     @OnClick(R.id.ll_rate_this_app) public void openAppInPlayStore() { openPlayStore(false, ""); } 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.