AndroidKeyValueStore - 一个基于 SQLite 的 Key/Value 存储框架

网友投稿 1048 2022-10-26

AndroidKeyValueStore - 一个基于 SQLite 的 Key/Value 存储框架

AndroidKeyValueStore - 一个基于 SQLite 的 Key/Value 存储框架

AndroidKeyValueStore

A KV store base on sqlite for Android Application. Inspired by YTKKeyValueStore.

Usage

Download the latest AAR or grab via Maven:

com.lusfold.androidkevaluestore library 0.1.0 aar

or Gradle:

compile 'com.lusfold.androidkeyvaluestore:library:0.1.0@aar'

Init before use:

KVStore.init(Context context,String databaseName)

or With a Database:

KVStore.init(SqliteDatabase database)

Destroy when app is down:

KVStore.destroy()

Then you can use like this:

KVStore.getInstance().setDebug(true); KVStore.getInstance().clearTable(); KVStore.getInstance().insert("a", "a"); KVStore.getInstance().delete("a"); KVStore.getInstance().insertOrUpdate("a", "b"); KVStore.getInstance().get("a"); KVStore.getInstance().getByPrefix("a"); KVStore.getInstance().getByContains("a");

More details please check source code.

License

Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at http://apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:C++核心准则SF.4:在其他声明之前include .h文件
下一篇:使用Windbg静态分析dump文件(实战经验总结)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~