Skip to content

Commit f8c051f

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 4183ce3 + 6b79280 commit f8c051f

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# JetDB - Super Sonic Shared Preferences
2+
3+
[![](https://jitpack.io/v/Binary-Finery/JetDB.svg)](https://jitpack.io/#Binary-Finery/JetDB)
4+
5+
- min SDK 16 (Android Jellybean 4.1)
6+
- written in Java
7+
8+
Simplified SharedPreferences, do it all in 1 line of code. JetDB goes the extra mile by allowing you to save/retreive ArrayLists and Lists of Objects with a simple, single line of code. It's never been easier.
9+
10+
## Installation
11+
12+
Add this into your root build.gradle file:
13+
14+
```java
15+
allprojects {
16+
repositories {
17+
...
18+
maven { url 'https://jitpack.io' }
19+
}
20+
}
21+
```
22+
23+
Add the dependency to your module build.gradle:
24+
25+
```java
26+
dependencies {
27+
implementation 'com.github.Binary-Finery:JetDB:1.0.1'
28+
}
29+
```
30+
31+
## Example Usage
32+
33+
save List of custom objects:
34+
```java
35+
JetDB.putListOfObjects(context, listObject, "usersKey");
36+
```
37+
get List of custom objects:
38+
```java
39+
List<User> users = JetDB.getListOfObjects(context, User.class, "usersKey");
40+
```
41+
save ArrayList:
42+
```java
43+
JetDB.putStringList(context, listObject, "namesKey");
44+
```
45+
get ArrayList:
46+
```java
47+
ArrayList<String> names = JetDB.getStringList(context, "namesList");
48+
```
49+
save single data:
50+
```java
51+
JetDB.putBoolean(context, true, "activeKey");
52+
```
53+
get single data:
54+
```java
55+
boolean isActive = JetDB.getBoolean(context, "activeKey");
56+
```
57+
58+
Please note: other data types can be used (Integer, Float etc) in addition to the ones in the example usages above
59+
60+
61+
62+

0 commit comments

Comments
 (0)