Skip to content

Commit

Permalink
Update readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
yehiahd committed Apr 3, 2018
1 parent d5a3439 commit db20d70
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 1 deletion.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
59 changes: 58 additions & 1 deletion README.md
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
````
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package="com.appizona.yehiahd.fastsaveexample">

<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
Expand Down
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());
}
}

0 comments on commit db20d70

Please sign in to comment.