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.
}// 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] =1234There are also StringKey, IntKey, LongKey, FloatKey, and BooleanKey.