Skip to content

Repository files navigation

Setup

  • build.gradle
buildscript {
repositories {
...
maven { url 'https://dl.bintray.com/boxresin/maven/' } // Add this line.
}
}
allprojects {
repositories {
...
maven { url 'https://dl.bintray.com/boxresin/maven/' } // Add this line.
}
}
  • app/build.gradle
dependencies {
...
implementation 'boxresin.android:preference:0.2.0'// Add this line.
}

Usage

// Define a key.val key =StringKey(keyName ="user_id", defaultValue ="none")
// Auto-casting as String, because 'key' is StringKeyval userId:String=Setting[key]
// Set value (only String type is allowed).Setting[key] ="test"// ErrorSetting[key] =1234

There are also StringKey, IntKey, LongKey, FloatKey, and BooleanKey.

About

SharedPreferences utility written in Kotlin

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages