Simple Android SharedPreferences wrapper.
Add this in your root build.gradle
file (not your module build.gradle
file):
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
Add this to your module's build.gradle
file (make sure the version matches the JitPack badge above):
dependencies {
...
compile 'com.github.GrenderG:Prefs:1.1'
}
Prefs.with(yourContext).readInt(YOUR_KEY_VALUE);
Prefs.with(yourContext).readInt(YOUR_KEY_VALUE, defaultValue);
Prefs.with(yourContext).writeInt(YOUR_KEY_VALUE, valueToStore);