All Projects → simpleton → Yasp

simpleton / Yasp

Licence: Apache-2.0 License
Yet Another Shared Preference

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Yasp

Pomegranate
🌳 A tiny skiplist based log-structured merge-tree written in Rust.
Stars: ✭ 20 (+25%)
Mutual labels:  kvstore
Preference-Rhythm
Android library makes using Shared Preference easier.
Stars: ✭ 16 (+0%)
Mutual labels:  sharedpreferences
rocks4j
KV Store for Java backed by RocksDB
Stars: ✭ 13 (-18.75%)
Mutual labels:  kvstore
DailyBugle
📰Modern MVVM Android application following single activity architecture which fetches news from 🕷️ news API. this repository contains some best practices ⚡ of android development
Stars: ✭ 17 (+6.25%)
Mutual labels:  sharedpreferences
RHKeyValueStore
Key-Value storage tool, based on WCDB (WeChat DataBase).
Stars: ✭ 20 (+25%)
Mutual labels:  kvstore
gocache
High performance and lightweight in-memory cache library with LRU and FIFO support as well as memory-usage-based-eviction
Stars: ✭ 15 (-6.25%)
Mutual labels:  kvstore
reactor
Reactor is key value database and is a great alternative to Shared Preferences.
Stars: ✭ 37 (+131.25%)
Mutual labels:  sharedpreferences
Kites
🪁 A consistency, partition tolerance completed distributed KV store, implementation of the Raft distributed consensus protocol and Kotlin.
Stars: ✭ 41 (+156.25%)
Mutual labels:  kvstore
iMoney
iMoney 金融项目
Stars: ✭ 55 (+243.75%)
Mutual labels:  sharedpreferences
RemotePreferences
A drop-in solution for inter-app access to SharedPreferences.
Stars: ✭ 121 (+656.25%)
Mutual labels:  sharedpreferences
ElegantData
像操作Room一样操作 SharedPreferences 和 File 文件.
Stars: ✭ 18 (+12.5%)
Mutual labels:  sharedpreferences
KVStorage
Android 结构化KV存储框架,基于 yaml 生成 java 结构化存储类
Stars: ✭ 228 (+1325%)
Mutual labels:  sharedpreferences
preferx
A reactive SharedPreferences library for Kotlin
Stars: ✭ 13 (-18.75%)
Mutual labels:  sharedpreferences
kesho
store cache any data type string, boolean, jsonObject, jsonArray, .....
Stars: ✭ 19 (+18.75%)
Mutual labels:  sharedpreferences
Quiz-App
A Quiz Android application 📱 built using Java ♨️ and showing best practices of 🛠️ Room
Stars: ✭ 33 (+106.25%)
Mutual labels:  sharedpreferences
simple-preferences
Android Library to simplify SharedPreferences use with code generation.
Stars: ✭ 48 (+200%)
Mutual labels:  sharedpreferences
MIT6.824-2021
4 labs + 2 challenges + 4 docs
Stars: ✭ 594 (+3612.5%)
Mutual labels:  kvstore
ToDoApp
📱My android playground app - Simple and Fastest todo app - developing to cover most android concepts, simple logic can make me focus more on framework
Stars: ✭ 28 (+75%)
Mutual labels:  sharedpreferences
memo
Android processing and secured library for managing SharedPreferences as key-value elements efficiently and structurally.
Stars: ✭ 18 (+12.5%)
Mutual labels:  sharedpreferences
toplingdb
ToplingDB is a cloud native LSM Key-Value Store with searchable compression algo and distributed compaction
Stars: ✭ 631 (+3843.75%)
Mutual labels:  kvstore

Yet Another SharedPreference

Download Build Status

This library try to introduce a high performance K-V store in Android development to instead of SharedPreference.

Why

If you only need to persist simple values and your application runs in a single process SharedPreferences is probably enough for you. It is a good default option.

There are some situations where SharedPreferences are not suitable for store KV data:

  1. Performance: Your data is complex or there is a lot of it
  2. Multiple thread accessing the data: invoke editor.appy() or editor.commit() multiple time, even apply will submit work to other thread.
  3. Multiple processes accessing the data: You have widgets or remote services that run in their own processes and require synchronized data

Yasp-leveldb

This library is wrapped LevelDB in java with SharedPreference interface.

Download

Use Gradle:

implementation 'com.simsun.yasp:yasp-leveldb:0.0.3'

API Usage

Almost compat with Android SharedPreference, but there is a little different during initializing.

Yasp will NOT load whole file when you access one parameter. Feel free to cache yasp instance in your Application.

Init

SharedPreferences sp = YASPContext.with(Context ct).getSharedPreferences(String name, int mode);

Do NOT support multiple processes currently

Get

As same as Android SharedPreference

sp.getString(String key, String defaultVal);

Editor

As same as Android SharedPreference

sp.edit()
  .putString(String key, String value)
  .putInt(String key, int value)
  .apply();

Benchmark

// TODO

Reference

  1. Best practices in Android development
  2. 请不要滥用SharedPreference
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].