Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Kotlin
dependencies {
implementation 'com.github.iamkurtgoz:EasyStore:3.1.1'
}
For Java Version:
dependencies {
implementation 'com.github.iamkurtgoz:EasyStore:2.2'
}
public class SampleApp extends Application {
@Override
public void onCreate() {
super.onCreate();
EasyStoreBuilder(getApplicationContext(), "mypreference", EasyStoreMode.MODE_PRIVATE);
}
}
//Variables
val name = "Mehmet Kurtgöz"
val age = 22
val weight = 80.5f
val total_days = 15L
val is_developer = true
name.save("Name")
//or
"Mehmet Kurtgöz".save("Name")
//or
EasyStore.save("Name", name)
age.save("AGE")
//or
22.save("AGE")
//or
EasyStore.save("AGE", age)
weight.save("WEIGHT")
//or
80f.save("WEIGHT")
//or
EasyStore.save("WEIGHT", weight)
total_days.save("TOTAL_DAYS")
//or
15L.save("TOTAL_DAYS")
//or
EasyStore.save("TOTAL_DAYS", total_days)
is_developer.save("DEVELOPER")
//or
true.save("DEVELOPER")
//or
EasyStore.save("DEVELOPER", is_developer)
listOf(
EasyModel("NAME", name),
EasyModel("AGE", age),
EasyModel("WEIGHT", weight),
EasyModel("TOTAL_DAYS", total_days),
EasyModel("DEVELOPER", is_developer)
).save()
Log.d("MyLog", "NAME: ${EasyStore.readString("NAME")}")
Log.d("MyLog", "AGE: ${EasyStore.readInt("AGE")}")
Log.d("MyLog", "WEIGHT: ${EasyStore.readFloat("WEIGHT")}")
Log.d("MyLog", "TOTAL_DAYS: ${EasyStore.readLong("TOTAL_DAYS")}")
Log.d("MyLog", "DEVELOPER: ${EasyStore.readBoolean("DEVELOPER")}")
OR
val name = EasyStore.read("name", "Mehmet")
val name: String = EasyStore.read("name")
....
val nameExist = EasyStore.existString("NAME")
val ageExist = EasyStore.existString("AGE")
val weightExist = EasyStore.existString("WEIGHT")
val totalDaysExist = EasyStore.existString("TOTAL_DAYS")
val developerExist = EasyStore.existString("DEVELOPER")
Contact : iamkurtgoz@gmail.com
EasyStore is released under the MIT license. See LICENSE for details.