A sp-like key-value library. Compatible with android native SharedPreferences.
- sp-like api, compatible with android native SharedPreferences.
- thread-safe & process-safe.
- based on mmap, don't worry about data loss.
- type-safe, type information is retained during persistence.
- runtime data verification, more secure.
- init
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
NoKV.init(this);
}
}
- create
SharedPreferences sp = NoKV.create("fuck1", MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.putInt("foo", 1);
editor.commit();
sp.getInt("foo", 0);