Description
SharePreferences is very popular with any project and all most all project has SharePreferences for saving data. This library will help you faster in configuration and use SharePreferences in your project. Let's setup and enjoy!
preferences-helper alternatives and similar packages
Based on the "Utility" category.
Alternatively, view preferences-helper alternatives based on common mentions on social networks and blogs.
-
StatusBarUtil
A util for setting status bar style on Android App. -
timber
A logger with a small, extensible API which provides utility on top of Android's normal Log class. -
ExpirableDiskLruCache
Java implementation of a Disk-based LRU cache which specifically targets Android compatibility. -
Byte Buddy
Runtime code generation for the Java virtual machine. -
tape
A lightning fast, transactional, file-based FIFO for Android and Java. -
joda-time-android
Joda-Time library with Android specialization -
tray
a SharedPreferences replacement for Android with multiprocess support -
OpenKeychain
OpenKeychain is an OpenPGP implementation for Android. -
AutobahnAndroid
WebSocket & WAMP in Java for Android and Java 8 -
easydeviceinfo
:iphone: [Android Library] Get device information in a super easy way. -
Android-Templates-And-Utilities
Collection of source codes, utilities, templates and snippets for Android development. -
secure-preferences
Android Shared preference wrapper than encrypts the values of Shared Preferences. It's not bullet proof security but rather a quick win for incrementally making your android app more secure. -
greenrobot-common
General purpose utilities and hash functions for Android and Java (aka java-common) -
Androl4b
A Virtual Machine For Assessing Android applications, Reverse Engineering and Malware Analysis -
vector-compat
A support library for VectorDrawable and AnimatedVectorDrawable classes introduced in Lollipop -
smoothie
Easy async loading for Android's ListView/GridView -
CastCompanionLibrary-android
CastCompanionLibrary-android is a library project to enable developers integrate Cast capabilities into their applications faster and easier. -
android_dbinspector
Android library for viewing, editing and sharing in app databases. -
AndroidBillingLibrary
Android Market In-app Billing Library -
motion
An Android library allowing images to exhibit a parallax effect that reacts to the device's tilt -
Colours
A beautiful set of predefined colors and a set of color methods to make your Android development life easier. -
EasyCamera
Wrapper around the android Camera class that simplifies its usage -
MrVector
[Deprecated] AKA VectorDrawableCompat: A 7+ backport of VectorDrawable -
Reservoir
Android library to easily serialize and cache your objects to disk using key/value pairs. -
davdroid
DAVdroid – CalDAV/CardDAV synchronization for Android 4+ devices -
android-validation-komensky
A simple library for validating user input in forms using annotations. -
Android-Validator
Form Validator Library for Android -
dspec
A simple way to define and render UI specs on top of your Android UI. -
routable-android
Routable, an in-app native URL router, for Android -
Treasure
Very easy to use wrapper library for Android SharePreferences -
RoboGif
A small utility to record Android device screen to a GIF
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of preferences-helper or a related project?
README
preferences-helper
SharePreferences is very popular with any project and all most all project has SharePreferences for saving data. This library will help you faster in configuration and use SharePreferences in your project. Let's setup and enjoy!
Setup
Add to build.gradle in app level
implementation 'com.github.tntkhang:preferences-helper:1.3.2'
Init the PreferencesHelper in your CustomApplication.java extend from Application with 2 ways:
Will use app name as of Preferences file name
PrefHelper.initHelper(this);
Will use
CustomName
as the name of SharePreferences filePrefHelper.initHelper(this, "CustomName");
- How to use
### SET VALUE:
PrefHelper.setVal(KEY_BOOLEAN, true);
PrefHelper.setVal(KEY_DOUBLE, 123.123);
PrefHelper.setVal(KEY_FLOAT, 234.234f);
PrefHelper.setVal(KEY_INT, 345);
PrefHelper.setVal(KEY_LONG, Long.MAX_VALUE);
PrefHelper.setVal(KEY_STRING, "Khang");
UserModel userModel = new UserModel("KhangTran", 27);
PrefHelper.setVal(KEY_OBJECT, userModel);
List<String> stringList = Arrays.asList("Tran", "Nguyen", "Thai", "Khang");
PrefHelper.setVal(KEY_ARRAY_LIST, stringList);
String[] arr = new String[4];
arr[0] = "Tran 2";
arr[1] = "Nguyen 2";
arr[2] = "Thai 2";
arr[3] = "Khang 2";
PrefHelper.setVal(KEY_ARRAY, arr);
Map<String, String> stringMap = new HashMap<>();
stringMap.put("Tr", "Tran");
stringMap.put("N", "Nguyen");
stringMap.put("Th", "Thai");
stringMap.put("K", "Khang");
PrefHelper.setVal(KEY_MAP, stringMap);
### GET VALUE:
boolean booleanValue = PrefHelper.getBooleanVal(KEY_BOOLEAN, false);
double doubleValue = PrefHelper.getDoubleVal(KEY_DOUBLE, Double.MIN_VALUE);
float floatValue = PrefHelper.getFloatVal(KEY_FLOAT, Float.MIN_VALUE);
int intValue = PrefHelper.getIntVal(KEY_INT, Integer.MIN_VALUE);
long longValue = PrefHelper.getLongVal(KEY_LONG, Long.MIN_VALUE);
String stringValue = PrefHelper.getStringVal(KEY_STRING, "Empty");
UserModel userModel = PrefHelper.getObjectVal(KEY_OBJECT, UserModel.class);
List<String> stringList = PrefHelper.getListVal(KEY_ARRAY_LIST);
String[] strings = PrefHelper.getArrayVal(KEY_ARRAY);
Map<String, String> stringMap = PrefHelper.getMapVal(KEY_MAP);
Map<String, ?> stringMap = PrefHelper.getAll();
# DEMO
Download and run project for simple demo
That is, let's enjoy!