ChanJLee / nokv

android sp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android Key-Value Library

desc

A sp-like key-value library. Compatible with android native SharedPreferences.

feature

  1. sp-like api, compatible with android native SharedPreferences.
  2. thread-safe & process-safe.
  3. based on mmap, don't worry about data loss.
  4. type-safe, type information is retained during persistence.
  5. runtime data verification, more secure.

usage

  1. init
public class MyApplication extends Application {
	@Override
	public void onCreate() {
		super.onCreate();
		NoKV.init(this);
	}
}
  1. create
SharedPreferences sp = NoKV.create("fuck1", MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.putInt("foo", 1);
editor.commit();
sp.getInt("foo", 0);

About

android sp


Languages

Language:C++ 60.7%Language:Java 31.1%Language:Shell 3.5%Language:CMake 1.7%Language:Kotlin 1.5%Language:Makefile 0.9%Language:C 0.6%