Wednesday 13 May 2015

Rate This App-Link Inside Your Apps on Mobile


How to Rate Your App on Your Mobile.



You can always call getInstalledPackages() from the PackageManager class and check to make sure the market class is installed. You could also use queryIntentActivities() to make sure that the Intent you construct will be able to be handled by something, even if it's not the market application. This is probably the best thing to do actually because its the most flexible and robust.

You can check if the market app is there by:

Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://search?q=foo"));
PackageManager pm = getPackageManager();
List<ResolveInfo> list = pm.queryIntentActivities(intent, 0);

You Can also Do in another way!!
You can use the following to launch Android Market on your application's page, it's a bit more automated:

Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse("market://details?id=" + getPackageName()));
startActivity(i);

Note: Don't test this in your emulator. If You want to do so, Install google-play on your emulator, then test it.

No comments:

Post a Comment