You must test the application using the applicationId installed on the device. for example, in your case applicationId is set to com.example.test . If the application has not been installed, you can bring the user to the market or let them choose the application.
String packageName = "com.example.test"; . . . Intent i = context.getPackageManager().getLaunchIntentForPackage(packageName); if (i == null) { i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse("market://details?id=" + packageName)); // Open app in google play store: // i.setData(Uri.parse("http://play.google.com/store/apps/details?id=" + appPackageName)); } i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(i);
source share