code: public static Intent newGooglePlayIntent(Context context, String packageName) {
          Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageName));
  
          if (!IntentUtils.isIntentAvailable(context, intent)) {
              intent = MediaIntents.newOpenWebBrowserIntent("https://play.google.com/store/apps/details?id="
                      + packageName);
          }
  
          if (intent != null) {
              intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
          }
  
          return intent;
      }
docs: Intent that should open either the Google Play app or if not available, the web browser on the Google Play website
  
  @param context     The context associated to the application
  @param packageName The package name of the application to find on the market
  @return the intent for native application or an intent to redirect to the browser if google play is not installed