Skip to content

LimeVista/Tapes

Repository files navigation

Tapes

A Non-SQL-Like Storage for Java/Kotlin on Android.

Initialize

  • Tapes.init(context) should be called UI thread.
// init it in the function of onCreate in Application or Activity.
Tapes.init(context);

Write Data

Save an object.

List<Data> content = ...
Tapes.track().write("content", content);

Read Data

Read an object.

// If key(content) not exist, the content value is null. 
List<Data> content = Tapes.track().read("content");

// Set default value.The method Null Safe.
List<Data> content = Tapes.track().read("content", new ArrayList<Data>());

Delete Data by Key

Tapes.track().clear("content");

Get all keys

//NonNull
List<String> allKey = Tapes.track().getAllKey();

Default Track

// Get default Track    
Track track = Tapes.track();
// or 
Track track = Tapes.track(null);
// or
Track track = Tapes.track(TAPES.INNER_DB_NAME);

Use custom track

Track track = Tapes.track("custom_track");

More API

Proguard

-keep class your.app.data.** { *; }
# if use implement Java Serializable
-keep class * implements java.io.Serializable { *; }

The Library Base On Kryo

License

Apache LicenseVersion 2.0, January 2004

About

A like Non-SQL Storage for Java/Kotlin on Android.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages