@@ -5,7 +5,7 @@ The main goal of this library is to reduce boilerplate code when you work with S
55
66# Usage
77First you do need to initalize this libarary inside onCreate of the Application class of your project.
8-
8+ ``` Java
99public class UniversalPreferencesApplication extends Application {
1010
1111 @Override
@@ -14,31 +14,35 @@ public class UniversalPreferencesApplication extends Application {
1414 UniversalPreferences . initialize(this );
1515 }
1616}
17-
17+ ```
1818Now you can use UniversalPreferences library in any class of your project.
1919
2020UniversalPreferences library is "universal" at accepting object types, so there is only one method to store and only one method to retrive values.
21-
21+ ``` Java
2222// Store and retrive String
2323UniversalPreferences . getInstance(). put(" string" , " some value" );
2424String string = UniversalPreferences . getInstance(). get(" string" );
25-
25+ ```
26+ ``` Java
2627// Store and retrive Integer
2728UniversalPreferences . getInstance(). put(" int" , 30 );
2829int value = UniversalPreferences . getInstance(). get(" int" );
29-
30+ ```
31+ ``` Java
3032// Store and retrive Float
3133UniversalPreferences . getInstance(). put(" float" , 3.0f );
3234float valueFloat = UniversalPreferences . getInstance(). get(" float" );
33-
35+ ```
36+ ``` Java
3437// Store and retrive Boolean
3538UniversalPreferences . getInstance(). put(" bool" , true );
3639boolean bool = UniversalPreferences . getInstance(). get(" bool" );
37-
40+ ```
41+ ``` Java
3842// Store and retrive Set<String>
3943Set<String > set = new HashSet<String > ();
4044set. add(" test 1" );
4145set. add(" test 2" );
4246UniversalPreferences . getInstance(). put(" set" , set);
4347Set<String > savedSet = UniversalPreferences . getInstance(). get(" set" );
44-
48+ ```
0 commit comments