Sunday, November 17, 2024
Google search engine
HomeLanguagesJavaHow to add Rate the App feature in Android

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




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


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




package org.neveropen.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);
    }
}


  1.  

Output: 
 

RELATED ARTICLES

Most Popular

Recent Comments