How to add Rate the App feature in Android

When you publish your app on google play store it is important to get feedback from the user. Unless the user does not love or hate your app, they are not likely to go out of their way to rate your app. Since high rating indicates the success of your app, and even criticism is required to make the application better. So, it is better to add a rate me feature in your app which helps you to get the feedback.

Importance of Rate me feature:- 

  • It improves the rating of your app in play store.
  • It helps you to improve your app (find bugs) by getting feedback.
  • It helps you to make decision on future updates of your app.

Approach: 
 

Step 1:



Add the support Library in build.gradle file and add Android-Rate dependency in the dependencies section. This library have a function which redirects the user to google play store and allows them to rate the application. It helps in getting the feedback. 
 

XML

filter_none

edit
close

play_arrow

link
brightness_4
code

dependencies {
    implementation 'com.github.hotchemi:android-rate:1.0.1'
}

chevron_right


Step 2:

In MainActivity.java file add the following code. This code will add the Rate me feature in the app.  The default functions such as setInstallDays allows the dialog box to appear after a certain number of days from the day of install of the app, setLaunchTimes  is the minimum number of times the app should be launched by the user and setRemindInterval is the number of days after which the dialog box comes after the user chooses the neutral option (Remind me later).
 

Java

filter_none

edit
close

play_arrow

link
brightness_4
code

package org.geeksforgeeks.gfgapprate;
  
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import hotchemi.android.rate.AppRate;
  
public class MainActivity
    extends AppCompatActivity {
  
    @Override
    protected void onCreate(
        Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
  
        // Here 0 means
        // the installation date.
        AppRate.with(this)
  
            // default 10
            .setInstallDays(1)
  
            // default 10
            .setLaunchTimes(3)
  
            // default 1
            .setRemindInterval(1)
            .monitor();
  
        // Show a dialogue
        // if meets conditions
        AppRate
            .showRateDialogIfMeetsConditions(
                this);
    }
}

chevron_right


  1.  

Output: 
 

Attention reader! Don’t stop learning now. Get hold of all the important Java and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.




My Personal Notes arrow_drop_up


If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


2


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.