-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
72 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,59 @@ | ||
# FastSave-Android | ||
An Android library for fast and easy access to Android Shared preferences. | ||
|
||
FastSave is An Android library for fast and easy access to Android Shared preferences. | ||
It allows you to save any type or list in the sharedpreferences and retrieve it in convenient way. | ||
|
||
# Installation | ||
|
||
<b>Add FastSave-Android to your app level build.gradle dependency</b> | ||
|
||
``` | ||
allprojects { | ||
repositories { | ||
... | ||
maven { url 'https://jitpack.io' } | ||
} | ||
} | ||
dependencies { | ||
implementation 'com.github.yehiahd:FastSave-Android:1.0.0' | ||
} | ||
``` | ||
|
||
You have to initialize the FastSave library inside your application class : | ||
|
||
```` | ||
public class MyApplication extends Application { | ||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
FastSave.init(getApplicationContext()); | ||
} | ||
} | ||
```` | ||
|
||
<b>Usage</b> | ||
|
||
```` | ||
FastSave.getInstance().saveInt(key,value); // For saving Integer value | ||
FastSave.getInstance().getInt(key); // For Getting Integer value | ||
FastSave.getInstance().saveFloat(key,value); // For saving Float value | ||
FastSave.getInstance().getFloat(key); // For Getting Float value | ||
// And so on for other types. | ||
//For Objects and Lists of Objects | ||
FastSave.getInstance().saveObject(key,customObject); // For Saving Custom Object | ||
FastSave.getInstance().getObject(key,classType); // For Getting Custom Object | ||
//Example on getting customObject | ||
FastSave.getInstance().getObject(key,Person.class); // assuming your custom class called Person | ||
FastSave.getInstance().saveObjectList(key,listOfCustomObjects); // For Saving Custom Objects List | ||
FastSave.getInstance().getObjectList(key,classType); // For Getting Custom Objects List | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
app/src/main/java/com/appizona/yehiahd/fastsaveexample/MyApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.appizona.yehiahd.fastsaveexample; | ||
|
||
import android.app.Application; | ||
|
||
import com.appizona.yehiahd.fastsave.FastSave; | ||
|
||
public class MyApplication extends Application { | ||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
FastSave.init(getApplicationContext()); | ||
} | ||
} |