Who doesn’t want their users to leave ratings for their application on the Play Store? But it is not the top thing on users’ minds (unless they are really annoyed by your app). Even if they want to rate your app, it is a rather cumbersome process for them to:
- Open the Play Store (temporarily abandoning whatever they are doing)
- Search for your app
- Find the one that is actually yours among a buttload (it is an actual unit of measurement) of other clones
- Rate your app
Simplifying the user flow
You might have seen in many apps that they provide a button or something similar which redirects them directly to the Play Store listing of their particular app. This short-circuits the first three steps in the above flow, providing user with a much shorter flow for rating your app.
Providing such an option requires mainly 2 steps from the developer:
- Displaying an option to user to rate the app (showing a button, dialog or something else)
- Launching the Play Store listing of that app on clicking the above presented option
1. Displaying “Rate-Me” option to user
There are many options to display an option to user for rating your app. I will be using a simple button for this purpose.
You have many other options like:
- Menu item
- Floating Action Button (FAB) in About screen of app
2. Launching the Play Store listing
Now comes the part where we launch the Store listing for our app when user clicks on whatever we displayed above. Continuing the above example, I have the below code in my Activity in which the above button is displayed.
Let me explain what the above code does.
If you have ever paid attention to the URL of the store-listing of any app on the Play Store then you would have noticed that the app’s package name is used as it’s unique identifier on the store. The structure is like this:
And a similar structure is followed by the URI for Play Store app:
So, we first try launching the Play Store app on the device, using the URI for the app (the
market://... one). If the Play Store app is present on the device then it is launched and the page containing listing of our app is opened.
If due to some conditions the Play Store app is not present (this can be the case with some custom ROMs), then
startActivity will throw the
ActivityNotFoundException exception and we then fall-back to opening our app’s listing on the web version of the Play Store using the browser.