Prefs

General

Category
Free
Tag
Preferences
License
Apache License, Version 2.0
Registered
Sep 22, 2014
Favorites
2
Link
https://github.com/alexrs/Prefs
See also
Preference-Rhythm
EasyPrefs
PreferenceBinder
SpCache
Stanley

Additional

Language
Java
Version
N/A
Created
Sep 13, 2014
Updated
Dec 7, 2017 (Retired)
Owner
Alejandro Rodríguez Salamanca (alexrs)
Contributors
Santiago Castro (bryant1410)
Alejandro Rodríguez Salamanca (alexrs)
2
Activity
Badge
Generate
Download
Source code

Prefs

Wrapper for Android Preferences which provides a fluid syntax.

Usage

This library is really easy to use.

Download

compile 'me.alexrs:prefs:1.1.0'

Save data

Prefs.with(context).save(key, value);

You can save:

  • String
  • int
  • float
  • long
  • boolean
  • Set<String>

Get data saved

// String
Prefs.with(context).getString(key, defValue);
// boolean
Prefs.with(context).getBoolean(key, defValue);
// int
Prefs.with(context).getInt(key, defValue);
// float
Prefs.with(context).getFloat(key, defValue);
//long
Prefs.with(context).getLong(key, defValue);
// Set<String>
Prefs.with(context).getStringSet(key, defValue);
//All
Prefs.with(context).getAll();

Remove data

Prefs.with(context).remove(key);

License

Copyright 2014 Alexrs95.

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.