INNER CODE UNIT · Java
appLaunched
owncloud/android · owncloudApp/src/main/java/com/owncloud/android/AppRater.java:42
public static void appLaunched(Context mContext, String packageName) {
SharedPreferences prefs = mContext.getSharedPreferences(APP_RATER_PREF_TITLE, 0);
if (prefs.getBoolean(APP_RATER_PREF_DONT_SHOW, false)) {
Timber.d("Do not show the rate dialog again as the user decided");
return;
}
SharedPreferences.Editor editor = prefs.edit();
/// Increment launch counter
long launchCount = prefs.getLong(APP_RATER_PREF_LAUNCH_COUNT, 0) + 1;
Timber.d("The app has been launched " + launchCount + " times");
editor.putLong(APP_RATER_PREF_LAUNCH_COUNT, launchCount);
/// Get date of first launch
long dateFirstLaunch = prefs.getLong(APP_RATER_PREF_DATE_FIRST_LAUNCH, 0);
if (dateFirstLaunch == 0) {
dateFirstLaunch = System.currentTimeMillis();