• Stars
    star
    549
  • Rank 80,988 (Top 2 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 11 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Android library to show "Rate this app" dialog

Android-RateThisApp

Build Status Download Android Arsenal

Android-RateThisApp is an library to show "Rate this app" dialog.

Screen shot

The library monitors the following status

  • How many times is the app launched
  • How long days does it take from the app installation

and show a dialog to engage users to rate the app in Google Play.

Getting Started

Dependency

dependencies {
    compile 'io.github.kobakei:ratethisapp:x.y.z'
}

x.y.z is Download

NOTICE: From 1.0.0, group ID has been changed from com.kobakei to io.github.kobakei.

Basic usage

Call RateThisApp.onCreate(Context) and RateThisApp.showRateDialogIfNeeded(Context) in your launcher activity's onCreate() method.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    // Monitor launch times and interval from installation
    RateThisApp.onCreate(this);
    // If the condition is satisfied, "Rate this app" dialog will be shown
    RateThisApp.showRateDialogIfNeeded(this);
}

That's all! You can see "Rate this app" dialog at an appropriate timing.

Advanced usages

Custom condition

In default, the dialog will be shown when any of the following conditions is satisfied.

  • App is launched more than 10 times
  • App is launched more than 7 days later than installation.

If you want to use your own condition, please call RateThisApp.init(Configuration) in your Application or launcher activity onCreate method.

// Custom condition: 3 days and 5 launches
RateThisApp.Config config = new RateThisApp.Config(3, 5);
RateThisApp.init(config);

Custom strings

You can override title, message and button labels.

RateThisApp.Config config = new RateThisApp.Config();
config.setTitle(R.string.my_own_title);
config.setMessage(R.string.my_own_message);
config.setYesButtonText(R.string.my_own_rate);
config.setNoButtonText(R.string.my_own_thanks);
config.setCancelButtonText(R.string.my_own_cancel);
RateThisApp.init(config);

Custom url

In default, rate button navigates to the application page on Google Play. You can override this url as below.

RateThisApp.Config config = new RateThisApp.Config();
config.setUrl("http://www.example.com");
RateThisApp.init(config);

Opt out from your code

If you want to stop showing the rate dialog, use this method in your code.

RateThisApp.stopRateDialog(this);

Callback

You can receive yes/no/cancel button click events.

RateThisApp.setCallback(new RateThisApp.Callback() {
    @Override
    public void onYesClicked() {
        Toast.makeText(MainActivity.this, "Yes event", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onNoClicked() {
        Toast.makeText(MainActivity.this, "No event", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onCancelClicked() {
        Toast.makeText(MainActivity.this, "Cancel event", Toast.LENGTH_SHORT).show();
    }
});

Contribute this project

If you want to contribute this project, please send pull request. In present, I need contributors who can translate resources from English/Japanese into other languages.

License

Copyright 2013-2017 Keisuke Kobayashi

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Author

Keisuke Kobayashi - [email protected]

More Repositories

1

MaterialFabSpeedDial

Android UI library of FAB speed dial
Kotlin
192
star
2

unity-gcm

Unity plugin for Google Cloud Messaging (GCM)
C#
60
star
3

spot

Android object-data mapper for SharedPreferences
Java
49
star
4

Anago

Android MVVM sample with data binding
Java
43
star
5

grenade

[DEPRECATED] Annotation based intent builder for Android activities and services
Java
29
star
6

CenteredDrawableButton

Android custom button with centered drawable
Java
26
star
7

CCLocalNotification

Local notification sample on cocos2d-x
C
23
star
8

AndroidNotificationShowcase

DroidKaigi 2018「開発者が知っておきたい通知の歴史」のサンプルコード
Kotlin
18
star
9

Android-Kotlin-Example

Android example written by Kotlin
Kotlin
14
star
10

Katsuo

Android sample that adopted the latest trend in Android development
Kotlin
12
star
11

sakanaloop

Synchronized PV player for SAKANACTION fans
JavaScript
5
star
12

PaintRoom

東京Node学園4で作ったリアルタイムお絵かきアプリ
JavaScript
4
star
13

DownloadHighlighter

Chrome extension to highlight links to archive/executable files.
JavaScript
4
star
14

go-anond

Goで作る匿名ダイアリーみたいなアプリ
Go
3
star
15

tweeclip

Clip tweets including links in your home timeline
JavaScript
2
star
16

android-dagger-sample

Android app with Dagger 2
Java
1
star
17

jquery_modal

jQuery plugin for modal dialog
JavaScript
1
star
18

realtime_paint

Realtime paint app (Node.js+Socket.IO+HTML5 Canvas)
JavaScript
1
star
19

express_multipart_sample

Node.js + Express File upload sample
JavaScript
1
star
20

QuickTweet

Google Chrome extension to tweet title and shortened URL of a webpage.
1
star
21

node_login_sample

Node.js+MongoDB(mongoose)+sechash
JavaScript
1
star
22

AndroidDataBindingSample

shibuya.apk #13のサンプル
Java
1
star
23

Scarborough

JavaScript
1
star