Tuesday, June 4, 2019

Home



Rating Android application Programmatically 

   
     To enable rating feature in your android application You can use below code.

   gradle dependency.

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


     
@override
  protected void onCreate(@Nullable Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);

  AppRate.with(this).setInstallDays(1)
           .setLaunchTimes(3)
           .setRemindInterval(1)
           .monitor();

  AppRate.showRateDialogIfMeetsConditions(this);




setInstallDays(1): After Number of days(1) of installation it triggers rate dialog.

setLaunchTimes(2): It says, after launching application two times, dialog will appear.

setRemindInterval(1): if you press Remind me later. then next time rating dialog will appear after one day.

AppRate.showRateDialogIfMeetsConditions(this) :  This line calls shows rating dialog by comparing all above mentioned conditions.