Need help with Prefs?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

GrenderG
127 Stars 22 Forks GNU General Public License v3.0 34 Commits 0 Opened issues

Description

Simple Android SharedPreferences wrapper.

Services available

!
?

Need anything else?

Contributors list

# 8,705
Java
file-pi...
cloudfl...
ui-widg...
30 commits

ko-fi

Prefs

Android Arsenal

Simple Android

SharedPreferences
wrapper.

Repository

Add this in your root

build.gradle
file (not your module
build.gradle
file):
allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

Dependency

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.3'
}

Usage

This is the basic usage, you can read values (specifying a default value or not) and write values like so: ``` java Prefs.with(yourContext).readInt(YOURKEYVALUE); Prefs.with(yourContext).readInt(YOURKEYVALUE, defaultValue);

Prefs.with(yourContext).writeInt(YOURKEYVALUE, valueToStore);

You can also specify a custom name for the preferences' name:
java Prefs.with(yourContext, "CUSTOMNAME").readInt(YOURKEYVALUE);
And force the re-instantiation of the Prefs instance:
java Prefs.with(yourContext, true).readInt(YOUR
KEYVALUE); Prefs.with(yourContext, "CUSTOMNAME", true).readInt(YOURKEYVALUE); ``
You can also set and retrieve
ordered String sets
and
unordered String sets`.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.