Skip to content

Commit db20d70

Browse files
committed
Update readme file
1 parent d5a3439 commit db20d70

File tree

4 files changed

+72
-1
lines changed

4 files changed

+72
-1
lines changed

.idea/caches/build_file_checksums.ser

0 Bytes
Binary file not shown.

README.md

+58-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,59 @@
11
# FastSave-Android
2-
An Android library for fast and easy access to Android Shared preferences.
2+
3+
FastSave is An Android library for fast and easy access to Android Shared preferences.
4+
It allows you to save any type or list in the sharedpreferences and retrieve it in convenient way.
5+
6+
# Installation
7+
8+
<b>Add FastSave-Android to your app level build.gradle dependency</b>
9+
10+
```
11+
allprojects {
12+
repositories {
13+
...
14+
maven { url 'https://jitpack.io' }
15+
}
16+
}
17+
18+
dependencies {
19+
implementation 'com.github.yehiahd:FastSave-Android:1.0.0'
20+
}
21+
22+
```
23+
24+
You have to initialize the FastSave library inside your application class :
25+
26+
````
27+
public class MyApplication extends Application {
28+
@Override
29+
public void onCreate() {
30+
super.onCreate();
31+
FastSave.init(getApplicationContext());
32+
}
33+
}
34+
35+
````
36+
37+
<b>Usage</b>
38+
39+
````
40+
FastSave.getInstance().saveInt(key,value); // For saving Integer value
41+
FastSave.getInstance().getInt(key); // For Getting Integer value
42+
43+
FastSave.getInstance().saveFloat(key,value); // For saving Float value
44+
FastSave.getInstance().getFloat(key); // For Getting Float value
45+
46+
// And so on for other types.
47+
48+
//For Objects and Lists of Objects
49+
50+
FastSave.getInstance().saveObject(key,customObject); // For Saving Custom Object
51+
FastSave.getInstance().getObject(key,classType); // For Getting Custom Object
52+
53+
//Example on getting customObject
54+
FastSave.getInstance().getObject(key,Person.class); // assuming your custom class called Person
55+
56+
FastSave.getInstance().saveObjectList(key,listOfCustomObjects); // For Saving Custom Objects List
57+
FastSave.getInstance().getObjectList(key,classType); // For Getting Custom Objects List
58+
59+
````

app/src/main/AndroidManifest.xml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package="com.appizona.yehiahd.fastsaveexample">
44

55
<application
6+
android:name=".MyApplication"
67
android:allowBackup="true"
78
android:icon="@mipmap/ic_launcher"
89
android:label="@string/app_name"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.appizona.yehiahd.fastsaveexample;
2+
3+
import android.app.Application;
4+
5+
import com.appizona.yehiahd.fastsave.FastSave;
6+
7+
public class MyApplication extends Application {
8+
@Override
9+
public void onCreate() {
10+
super.onCreate();
11+
FastSave.init(getApplicationContext());
12+
}
13+
}

0 commit comments

Comments
 (0)