All Projects → johnjohndoe → Typedpreferences

johnjohndoe / Typedpreferences

Licence: apache-2.0
Preference wrappers for primitive types for Android

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Typedpreferences

Colorpreference
A custom preference item for easy implementation of a color picker in Android's preference screen.
Stars: ✭ 299 (+56.54%)
Mutual labels:  preferences, sharedpreferences
PowerPreference
💾 A Powerful library to control and simplify the usage of shared preference in Android.
Stars: ✭ 95 (-50.26%)
Mutual labels:  preferences, sharedpreferences
Ksprefs
🚀⚡ Kotlin SharedPreferences wrapper & cryptographic preferences android library.
Stars: ✭ 176 (-7.85%)
Mutual labels:  wrapper, sharedpreferences
Multiplatform Preferences
Kotlin Multi Platform Preferences, for android an ios : SharedPreferences & NSUserDefault
Stars: ✭ 76 (-60.21%)
Mutual labels:  preferences, 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 (+153.4%)
Mutual labels:  preferences, sharedpreferences
Preferenceroom
🚚 Android processing library for managing SharedPreferences persistence efficiently and structurally.
Stars: ✭ 341 (+78.53%)
Mutual labels:  preferences, sharedpreferences
Prefser
Wrapper for Android SharedPreferences with object serialization and RxJava Observables
Stars: ✭ 228 (+19.37%)
Mutual labels:  preferences, sharedpreferences
Hawk
✔️ Secure, simple key-value storage for Android
Stars: ✭ 3,827 (+1903.66%)
Mutual labels:  preferences, sharedpreferences
Materialpreferences
A highly flexible set of lovely looking views that provides functionality of preferences.
Stars: ✭ 495 (+159.16%)
Mutual labels:  preferences, sharedpreferences
Bulldog
Android library to simplify reading and writing to SharedPreferences, never write code like this anymore prefs.edit().putString("someKey","someString").apply()
Stars: ✭ 133 (-30.37%)
Mutual labels:  preferences, sharedpreferences
Modernavplayer
ModernAVPlayer is a persistence AVPlayer wrapper
Stars: ✭ 179 (-6.28%)
Mutual labels:  wrapper
Macos Fn Toggle
A macOS app to quickly toggle the behavior of the fn key.
Stars: ✭ 178 (-6.81%)
Mutual labels:  preferences
Swiftdb
A modern database abstraction layer, batteries included.
Stars: ✭ 183 (-4.19%)
Mutual labels:  wrapper
Godot Kotlin Native
Kotlin bindings for Godot Engine
Stars: ✭ 186 (-2.62%)
Mutual labels:  wrapper
Android Prefs
Android preferences for WINNERS!
Stars: ✭ 183 (-4.19%)
Mutual labels:  sharedpreferences
Tdl
Node.js bindings to TDLib.
Stars: ✭ 177 (-7.33%)
Mutual labels:  wrapper
Rocksdb Sharp
.net bindings for the rocksdb by facebook
Stars: ✭ 173 (-9.42%)
Mutual labels:  wrapper
Keras Multi Head
A wrapper layer for stacking layers horizontally
Stars: ✭ 172 (-9.95%)
Mutual labels:  wrapper
Uniswap Python
🦄 The unofficial Python client for the Uniswap exchange.
Stars: ✭ 191 (+0%)
Mutual labels:  wrapper
Frideos flutter
An all-in-one Fllutter package for state management, reactive objects, animations, effects, timed widgets etc.
Stars: ✭ 187 (-2.09%)
Mutual labels:  sharedpreferences

Travis build status Maven Central Apache License Methods count

Typed Preferences

Typed Preferences Icon

This library for Android provides classes which allow to store and retrieve settings from the preferences. There is an individual class for each native type:

Each class comes with two constructors - one of them allows to ommit the default value.

All classes declare the same methods: get(), isSet(), set() and delete(). Here are the method signatures as definied in the StringPreference class.

public class StringPreference {
    public String get() { ... }
    public boolean isSet() { ... }
    public void set(String value) { ... }
    public void delete() { ... }
}

Wrappers for frequently used classes can be found and added in the wiki. Take a look!

How to get the thing running?

Add the library as a dependency to your build.gradle in case you use Gradle:

dependencies {
    compile "info.metadude.android:typed-preferences:{$version}"
}

Or if you use Maven you should be looking for this:

<dependency>
    <groupId>info.metadude.android</groupId>
    <artifactId>typed-preferences</artifactId>
    <version>{$version}</version>
</dependency>

For anything else, go to Maven Central - or just build the library yourself.

Minimum SDK version / API level

The library is available in two different versions. If you need to support API level 8 in your project you must include the latest 1.x.x version. This library version persists the settings synchronously using the commit method of the SharedPreferences.Editor. If the minimum SDK version you need to support is API level 9 you can choose the latest 2.x.x version which relies on the apply method of the SharedPreferences.Editor. Thereby settings are persisted asynchronously.

For further information please stick to documentation of the SharedPreferences.Editor interface.

Demo project

Check out the demo project TypedPreferencesDemo which shows how to use the library.

Tests

Run ./gradlew clean test to execute the tests.

Feedback

If you use this library and you are happy with it please send a tweet to @tbsprs and feel free to announce your app. I will be happy to list it here.

In case you do not like the library please do not hesitate to open an issue and let me know what can be improved.

Which applications are using this library?

Reference

This library is mainly inspired by the classes which have been published by Jake Wharton in the u2020 project.

Authors

Contributors

License

Copyright 2014-2018 Tobias Preuss

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
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].