Popularity
3.2
Growing
Activity
4.6
-
189
6
19

Code Quality Rank: L3
Programming language: Java
Tags: Utility    
Latest version: v3.0.2

esperandro alternatives and similar packages

Based on the "Utility" category

Do you think we are missing an alternative of esperandro or a related project?

Add another 'Utility' Package

README

Maven Central Build Status

esperandro

Easy SharedPreference Engine foR ANDROid

Please refer to the wiki for in-depth examples.

See the [changelog](changelog.md) for a brief overview of recent changes.

Short example

esperandro makes it simple to use SharedPreferences in a nicer and less error-prone way.

Without esperandro a key is referenced by a string:

  • String myPreference = preferences.getString("myPreference", "default value") // load preference
  • preferences.edit().putString("myPreference", myPreference).commit() // store preference

With esperandro you adhere to an interface that you defined:

@SharedPreferences
interface MyPreferences {
    String myPreference();
    void myPreference(String myPreference);
}
  • String myPreference = preferences.myPreference() // load preference
  • preferences.myPreference(myPreference) // store preference

Type safe, easy, less error-prone.

Interested? Get Started

Gradle artifacts

// essential dependencies
implementation 'de.devland.esperandro:esperandro-api:<insert version>'
annotationProcessor 'de.devland.esperandro:esperandro-preference-gen:<insert version>'

// optional, if object serialization is needed via gson
implementation 'de.devland.esperandro:esperandro-gson-addon:<insert version>'

// optional, if object serialization is needed via jackson
implementation 'de.devland.esperandro:esperandro-jackson-addon:<insert version>'

// additional processor to generate a file with all keys as string constants
annotationProcessor 'de.devland.esperandro:esperandro-keys-gen:<insert version>'

// additional processor to generate a file with all keys as string resources
annotationProcessor 'de.devland.esperandro:esperandro-resources-gen:<insert version>'