An open API service indexing awesome lists of open source software.

https://github.com/jingle1267/androidkeyvalue

Android上基于realm数据库的k-v工具类
https://github.com/jingle1267/androidkeyvalue

androidkeyvalue keyvalue kv

Last synced: about 1 year ago
JSON representation

Android上基于realm数据库的k-v工具类

Awesome Lists containing this project

README

          

# AndroidKeyValue

[![](https://jitpack.io/v/jingle1267/AndroidKeyValue.svg)](https://jitpack.io/#jingle1267/AndroidKeyValue)

Android上基于realm数据库的k-v工具类

### 快速使用

#### 添加依赖

```
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```

```
dependencies {
compile 'com.github.jingle1267:AndroidKeyValue:1.0.4'
}
```

#### 1. init

```JAVA
Realm.init(getApplicationContext());
```

#### 2. insert & update

```JAVA
KeyValueUtil.insertOrUpdate("key1", value);
```

#### 3. delete

```JAVA
KeyValueUtil.delete("key1");
```

#### 4. select

```JAVA
List list = KeyValueUtil.query("key1");
```

本组件基于Realm数据库。https://realm.io/docs/java/latest/