All Projects → bilibili → Xpref

bilibili / Xpref

Licence: apache-2.0
A SharedPreferences' wrapper that truly supported sharing data across multi-process

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Xpref

Rxkprefs
🛠 A small Kotlin library to make shared preferences easy + RxJava and Coroutines support
Stars: ✭ 264 (+230%)
Mutual labels:  sharedpreferences
Kotpref
Kotpref - Android SharedPreferences delegation library for Kotlin
Stars: ✭ 618 (+672.5%)
Mutual labels:  sharedpreferences
Android Debug Database
A library for debugging android databases and shared preferences - Make Debugging Great Again
Stars: ✭ 7,946 (+9832.5%)
Mutual labels:  sharedpreferences
Preferenceroom
🚚 Android processing library for managing SharedPreferences persistence efficiently and structurally.
Stars: ✭ 341 (+326.25%)
Mutual labels:  sharedpreferences
Materialpreferences
A highly flexible set of lovely looking views that provides functionality of preferences.
Stars: ✭ 495 (+518.75%)
Mutual labels:  sharedpreferences
Typedvalue
Tiny library to simplify access to SharedPreferences, Bundle or any other key-value storage
Stars: ✭ 18 (-77.5%)
Mutual labels:  sharedpreferences
Yasp
Yet Another Shared Preference
Stars: ✭ 16 (-80%)
Mutual labels:  sharedpreferences
Secure Pref Manager
Secure Preference Manager for android. It uses various Encryption to protect your application's Shared Preferences.
Stars: ✭ 75 (-6.25%)
Mutual labels:  sharedpreferences
Secured Preference Store
A cryptography library and a SharedPreferences wrapper for Android that encrypts the content with 256 bit AES encryption. The Encryption key is securely stored in device's KeyStore.
Stars: ✭ 562 (+602.5%)
Mutual labels:  sharedpreferences
Easypreferences
This class simplifies calls to SharedPreferences in a line of code. It can also do more like: saving a list of strings, integers and saving images. All in 1 line of code!
Stars: ✭ 34 (-57.5%)
Mutual labels:  sharedpreferences
Hawk
✔️ Secure, simple key-value storage for Android
Stars: ✭ 3,827 (+4683.75%)
Mutual labels:  sharedpreferences
Binaryprefs
Rapidly fast and lightweight re-implementation of SharedPreferences which stores each preference in files separately, performs disk operations via NIO with memory mapped byte buffers and works IPC (between processes). Written from scratch.
Stars: ✭ 484 (+505%)
Mutual labels:  sharedpreferences
Harmony
Multi-process SharedPreference implementation without ContentProvider
Stars: ✭ 27 (-66.25%)
Mutual labels:  sharedpreferences
Colorpreference
A custom preference item for easy implementation of a color picker in Android's preference screen.
Stars: ✭ 299 (+273.75%)
Mutual labels:  sharedpreferences
Easyandroid
一系列简单、轻量、方便的Android开发工具集合(持续更新中),包括Android动态权限、SharedPreferences、反射、日志、Toast、Bundle、MVP、线程池、Html、图文混排、蒙层引导、拍照、图库选择等
Stars: ✭ 1,039 (+1198.75%)
Mutual labels:  sharedpreferences
pref dessert
Package that allows you persist objects as shared preferences easily.
Stars: ✭ 12 (-85%)
Mutual labels:  sharedpreferences
Shpref Library
💾 Android Kotlin library. Shared preferences wrapper. (2020)
Stars: ✭ 16 (-80%)
Mutual labels:  sharedpreferences
Multiplatform Preferences
Kotlin Multi Platform Preferences, for android an ios : SharedPreferences & NSUserDefault
Stars: ✭ 76 (-5%)
Mutual labels:  sharedpreferences
Easysp
A SharedPreferences wrapper that has a fluent interface to store data
Stars: ✭ 75 (-6.25%)
Mutual labels:  sharedpreferences
Mlcache
A library make cache easily
Stars: ✭ 9 (-88.75%)
Mutual labels:  sharedpreferences

Xpref

A SharedPreferences' wrapper that truly supported sharing data across multi-process

Principle

ContentProvider is designed to provide content between multiple applications that means it supported sharing data between multi-process. Use it to wrap the SharedPreferences can make the latter truly cross-process sharing data

Usage

Add dependency to your gradle script:

dependencies {
    implementation 'com.bilibili.lib:x-pref:1.2'
}

Note that this library is written with kotlin 1.2.10.

  1. Gets the default SharedPreferences which is typically used in the Settings of an APP.
Xpref.getDefaultSharedPreferences(context)
  1. Gets a SharedPreferences with specific named.
val name = "awesome"
Xpref.getSharedPreferences(context, name)
  1. Extension in Kotlin.

You can declare extension functions in somewhere on your need for better convenience usage like following:

fun <T: ContextWrapper> T.xpref() = Xpref.getDefaultSharedPreferences(this)

fun <T: ContextWrapper> T.xpref(name: String) = Xpref.getSharedPreferences(this, name)
// in Activity
class AnActivity : Activity() {
    private fun getPreferences() = this.xpref("awesome")
}

// in Service
class AService : Service() {
    private fun getPreferences() = this.xpref("awesome")
}

The other usage is the same as normal SharedPreferences.

Have fun!

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].