Static way to use android preferences, no hassle
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
gradle/wrapper
library
sample
.gitignore
.yo-rc.json
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

PainlessPrefs

Static way to set/get shared preferences

As simple as it gets:

// save key/value pair
PainlessPrefs.getInstance(context)
	.save("SOME_KEY", true);

// getting it back
boolean someBoolean =
	PainlessPrefs.getInstance(context)
	.getBoolean("SOME_KEY", DEFAULT_VALUE);

Installation

Add it in your root build.gradle at the end of repositories:

allprojects {
		repositories {
			...
			maven { url "https://jitpack.io" }
		}
	}

Now add your dependency:

dependencies {
	compile 'com.github.cesarferreira:PainlessPrefs:0.1.0'
}