This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context | |
import android.os.Environment | |
import android.util.Log | |
import java.io.* | |
import java.security.SecureRandom | |
import javax.crypto.Cipher | |
import javax.crypto.SecretKeyFactory | |
import javax.crypto.spec.IvParameterSpec | |
import javax.crypto.spec.PBEKeySpec | |
import javax.crypto.spec.SecretKeySpec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.annotation.NonNull; | |
import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.concurrent.TimeUnit; | |
import okhttp3.Cache; | |
import okhttp3.CacheControl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class PreferenceUtilities { | |
public static final String KEY_WATER_COUNT = "water-count"; | |
public static final String KEY_CHARGING_REMINDER_COUNT = "charging-reminder-count"; | |
private static final int DEFAULT_COUNT = 0; | |
synchronized private static void setWaterCount(Context context, int glassesOfWater) { | |
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); | |
SharedPreferences.Editor editor = prefs.edit(); |