You may have a SharedPreferencevalue that stores the timestamp of the last photo in milliseconds. Then, whenever the user saves the photo, check the preference value if it does nothing today and if the next day adds an account to the user and updates the preference value to the new timestamp.
Here is the code structure with Joda DateTime.
public void onSavePhoto() {
SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
long lastSaveTime = settings.getLong("last_save", 0);
int lastDay = new DateTime(lastSaveTime).getDayOfYear();
int today = DateTime.now().getDayOfYear();
if (lastDay < today) {
addScore();
SharedPreferences.Editor editor = settings.edit();
editor.putLong("last_save", today);
}
}
source
share