Skip to content

Commit 28e5cc3

Browse files
author
Zoran Pavlovic
committed
readme fix
1 parent 5d8bea8 commit 28e5cc3

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The main goal of this library is to reduce boilerplate code when you work with S
55

66
# Usage
77
First you do need to initalize this libarary inside onCreate of the Application class of your project.
8-
8+
```Java
99
public class UniversalPreferencesApplication extends Application {
1010

1111
@Override
@@ -14,31 +14,35 @@ public class UniversalPreferencesApplication extends Application {
1414
UniversalPreferences.initialize(this);
1515
}
1616
}
17-
17+
```
1818
Now you can use UniversalPreferences library in any class of your project.
1919

2020
UniversalPreferences 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
2323
UniversalPreferences.getInstance().put("string", "some value");
2424
String string = UniversalPreferences.getInstance().get("string");
25-
25+
```
26+
```Java
2627
// Store and retrive Integer
2728
UniversalPreferences.getInstance().put("int", 30);
2829
int value = UniversalPreferences.getInstance().get("int");
29-
30+
```
31+
```Java
3032
// Store and retrive Float
3133
UniversalPreferences.getInstance().put("float", 3.0f);
3234
float valueFloat = UniversalPreferences.getInstance().get("float");
33-
35+
```
36+
```Java
3437
// Store and retrive Boolean
3538
UniversalPreferences.getInstance().put("bool", true);
3639
boolean bool = UniversalPreferences.getInstance().get("bool");
37-
40+
```
41+
```Java
3842
// Store and retrive Set<String>
3943
Set<String> set = new HashSet<String>();
4044
set.add("test 1");
4145
set.add("test 2");
4246
UniversalPreferences.getInstance().put("set", set);
4347
Set<String> savedSet = UniversalPreferences.getInstance().get("set");
44-
48+
```

0 commit comments

Comments
 (0)