To improve your Google Play rating count, you may need to prompt your users to rate your app. This is important however good your app may be. The following examples and libraries explore how to create such type of a dialog:

1. RateDialog

RateDialog is an android library to display a rate dialog in an easy way.

Below is the demo Screenshot

Here are its features:

Java-S: Bài 44. Tạo hộp thoại (Dialog) với JOptionPane: showMessageDialog, showConfirmDialog,showInputDialog

Java-S: Bài 44. Tạo hộp thoạ...
Java-S: Bài 44. Tạo hộp thoại (Dialog) với JOptionPane: showMessageDialog, showConfirmDialog,showInputDialog
  • Roboto font
  • Multilanguage
  • Easy configuration
  • Fully material designed

RateDialog currently supports the following languages:

  • English (default)
  • Spanish
  • German
  • French
  • Italian
  • Dutch
  • Portuguese
  • Brazilian
  • Russian
  • Polish
  • Turkish

Step 1: Install it

Add this to your root _MARKDOWN_HASHc197962302397baf3a4cc36463dce5eaMARKDOWNHASH

file:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Now add the dependency to your app build.gradle file:

implementation 'com.github.marcoscgdev:RateDialog:1.0.7'

Step 2: Creating the Rating dialog

Show the dialog each 3 days and each 7 launches (default config):

RateDialog.init(this);

Shows the dialog with custom config:

RateDialog.init(this, 2, 0); // daysUntilPrompt, launchesUntilPrompt

You can also get the default config values:

RateDialog.DEFAULT_DAYS_UNTIL_PROMPT
RateDialog.DEFAULT_LAUNCHES_UNTIL_PROMPT

Show the dialog instantly:

RateDialog.showDialog(this);

Step 3: Creating custom dialog instance

RateDialog rateDialog = new RateDialog(this, "custom_rate_dialog_key");
rateDialog.init();

You can also use custom config

RateDialog rateDialog = new RateDialog(this, "custom_rate_dialog_key", daysUntilPrompt, launchesUntilPrompt);

Show the custom dialog instantly:

RateDialog rateDialog = new RateDialog(this, "custom_rate_dialog_key");
rateDialog.showDialog();

NOTE: Use a different dialog key for each dialog instance.

Custom dialog strings (just override it):

<string name="rate_dialog_title">Rate %s.</string>
<string name="rate_dialog_message">If you enjoy using %s, please help us by rating it. It only takes a few seconds!</string>
<string name="rate_dialog_action_rate">Rate</string>
<string name="rate_dialog_action_never">No, thanks</string>
<string name="rate_dialog_action_later">Later</string>
<string name="rate_dialog_thank_you">Thank you!</strin

RateDialog Full Example

Here is a full example of how to use the RateDialog

1. Layouts

We have one layout:

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.marcoscg.ratedialogsample.MainActivity">

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:text="Open rate dialog"
        android:onClick="openRateDialog"/>

</RelativeLayout>

2. Code

MainActivity.java

package com.marcoscg.ratedialogsample;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import com.marcoscg.ratedialog.RateDialog;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        RateDialog.init(this); // Shows the dialog each 3 days and each 7 launches (default config)
//        RateDialog.init(this, 2, RateDialog.DEFAULT_LAUNCHES_UNTIL_PROMPT);  // Shows the dialog with custom config.

        // Custom dialog instance
//        RateDialog rateDialog = new RateDialog(this, "custom_rate_dialog", 0 , 3);
//        rateDialog.init();
    }

    public void openRateDialog (View v) {
        RateDialog rateDialog = new RateDialog(this, "custom_rate_dialog_key");
        rateDialog.showDialog();
    }

}

Reference

Download code here.
Read more here.
Follow code author here.

Read Individually.