public static void app_launched(Context mContext){
  SharedPreferences prefs=mContext.getSharedPreferences("apprater",0);
  if (prefs.getBoolean("dontshowagain",false)) {
    return;
  }
  SharedPreferences.Editor editor=prefs.edit();
  long launch_count=prefs.getLong("launch_count",0) + 1;
  editor.putLong("launch_count",launch_count);
  Long date_firstLaunch=prefs.getLong("date_firstlaunch",0);
  if (date_firstLaunch == 0) {
    date_firstLaunch=System.currentTimeMillis();
    editor.putLong("date_firstlaunch",date_firstLaunch);
  }
  if (launch_count >= LAUNCHES_UNTIL_PROMPT) {
    if (System.currentTimeMillis() >= date_firstLaunch + (DAYS_UNTIL_PROMPT * 24 * 60* 60* 1000)) {
      showRateDialog(mContext,editor);
    }
  }
  editor.apply();
}

public static void app_launched ( Context mContext ) { SharedPreferences prefs = mContext . getSharedPreferences ( "apprater" , 0 ) ; if ( prefs . getBoolean ( "dontshowagain" , false ) ) { return ; } SharedPreferences . Editor editor = prefs . edit ( ) ; long launch_count = prefs . getLong ( "launch_count" , 0 ) + 1 ; editor . putLong ( "launch_count" , launch_count ) ; Long date_firstLaunch = prefs . getLong ( "date_firstlaunch" , 0 ) ; if ( date_firstLaunch == 0 ) { date_firstLaunch = System . currentTimeMillis ( ) ; editor . putLong ( "date_firstlaunch" , date_firstLaunch ) ; } if ( launch_count >= LAUNCHES_UNTIL_PROMPT ) { if ( System . currentTimeMillis ( ) >= date_firstLaunch + ( DAYS_UNTIL_PROMPT * 24 * 60 * 60 * 1000 ) ) { showRateDialog ( mContext , editor ) ; } } editor . apply ( ) ; }
launch rate the app dialogue when the app is launched for the first time .
