Android Rate


Source link: https://github.com/hotchemi/Android-Rate

Android-Rate

Android-Rate is a library to help you promote your android app by prompting users to rate the app after using it for a few days.

Install

You can download from maven central.

${ latest.version } is

dependencies {

compile 'com.github.hotchemi:android-rate:{
latest.version
}
' 
}

Usage

Configuration

Android-Rate provides methods to configure its behavior.

@Override protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

 AppRate.with(this)

 .setInstallDays(0) // default 10, 0 means install day.

 .setLaunchTimes(3) // default 10

 .setRemindInterval(2) // default 1

 .setShowLaterButton(true) // default true

 .setDebug(false) // default false

 .setOnClickButtonListener(new OnClickButtonListener() {
 // callback listener.

  @Override

  public void onClickButton(int which) {

Log.d(MainActivity.class.getName(), Integer.toString(which));

  
}

 
}
)

 .monitor();

 // Show a dialog if meets conditions
AppRate.showRateDialogIfMeetsConditions(this);
 
}

The default conditions to show rate dialog is as below:

  1. App is launched more than 10 days later than installation. Change via AppRate#setInstallDays(int).
  2. App is launched more than 10 times. Change via AppRate#setLaunchTimes(int).
  3. App is launched more than 2 days after neutral button clicked. Change via AppRate#setRemindInterval(int).
  4. App shows neutral dialog(Remind me later) by default. Change via setShowLaterButton(boolean).
  5. To specify the callback when the button is pressed. The same value as the second argument of DialogInterface.OnClickListener#onClick will be passed in the argument of onClickButton.
  6. Setting AppRate#setDebug(boolean) will ensure that the rating request is shown each time the app is launched. This feature is only development!.

Clear show dialog flag

When you want to show the dialog again, call AppRate#clearAgreeShowDialog().

AppRate.with(this).clearAgreeShowDialog();

When the button presses on

call AppRate#showRateDialog(Activity).

AppRate.with(this).showRateDialog(this);

Set custom view

call AppRate#setView(View).

LayoutInflater inflater = (LayoutInflater)this.getSystemService(LAYOUT_INFLATER_SERVICE);
 View view = inflater.inflate(R.layout.custom_dialog, (ViewGroup)findViewById(R.id.layout_root));
 AppRate.with(this).setView(view).monitor();

Custom dialog

If you want to use your own dialog labels, override string xml resources on your application.

<resources>
  <string name="rate_dialog_title">Rate this app</string>
  <string name="rate_dialog_message">If you enjoy playing this app, would you mind taking a moment to rate it? It won\'t take more than a minute. Thanks for your support!</string>
  <string name="rate_dialog_ok">Rate It Now</string>
  <string name="rate_dialog_cancel">Remind Me Later</string>
  <string name="rate_dialog_no">No, Thanks</string> </resources>

Language

Android-Rate currently supports the following languages:

  • English
  • Czech
  • German
  • Spanish
  • Basque
  • Persian
  • French
  • Italy
  • Hebrew
  • Japanese
  • Korean
  • Polish
  • Portuguese
  • Russian
  • Turkish
  • Ukrainian
  • Vietnamese
  • Chinese

Support

Android-Rate supports API level 9 and up.

Sample

Please try to move the sample.

Contribute

  1. Fork it
  2. Create your feature branch ( git checkout -b my-new-feature)
  3. Commit your changes ( git commit -am 'Added some feature')
  4. Push to the branch ( git push origin my-new-feature)
  5. Create new Pull Request

Resources

Crash fast library for Android.

Simple precondition library for crashing in case you find unexpected values. For example: After you login against a certain API, you have to get back your user. It's completely necessary to have a no null user, so you can checkNotNull(receivedUser).

A menu layout view with FloatingActionButton, which means you still can use the features of FAB like auto hide while scrolling.

Pan

A light weight MV* framework to build android reusable UI components.

rog

Rog is an object generator designed for android test. It can create objects and set random values to their fields.

Spark is a simple Android library that takes a series of x,y points at any scale and draws them as a sparkline chart.

It's a framework for building Android UI in Kotlin code by using the concept of virtual views and reactive data flow, the goal is to reduce boilerplate while retaining the same Android layout constructs.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes