Easy-SharedPreferences
A Simple Library to store data on shared preferences
Note: Purley Written in Kotlin
(https://jitpack.io/#AmanpreetYatin/Easy-SharedPreferences/0.1.1 )
EasySharedPreferences is a powerful library to work with key-value storages in Android
Download
Step 1. Add this in your root (Project) build.gradle at the end of repositories:
allprojects { repositories { ... maven { url "https://jitpack.io" } } }
Step 2. Add the dependency
implementation 'com.github.AmanpreetYatin:Easy-SharedPreferences:0.1.1'
Usage
JAVA
EasySharedPreferenceConfig.Companion.initDefault(new EasySharedPreferenceConfig.Builder() .inputFileName("easy_preference") .inputMode(Context.MODE_PRIVATE) .build());
Kotlin
override fun onCreate() { super.onCreate()
EasySharedPreferenceConfig.initDefault(EasySharedPreferenceConfig.Builder() .inputFileName("easy_preference") .inputMode(Context.MODE_PRIVATE) .build()) }
EXAMPLE::
EasySharedPreference.Companion.putString("KEY", "value");
EasySharedPreference.Companion.getString("KEY", "DefaultValue");