FudiSharePreference Tutorial

1. Introduction

Target & How setup

This is a tutorial for introducing a how to save and how to load any object in your Android Project, First at all, need add the dependency repository and library into your gradle files:

Please replace the following latestVersion annotation with latest version

repositories {
    jcenter()
}
dependencies {
    implementation 'com.romellfudi.store:fudi-store:{latestVersion}'
    implementation 'com.romellfudi.store:kotlin-fudi-store:{latestVersion}'
}

Dependencies

Knowledge Basic programming

2. Setting up

To start you need a code with interfaces classes or adapter patterns.

Download the Code

Click the following link to download all the code for this tutorial:

Download source code

What you'll learn

What you'll need

3. Implementation

Add annotations:

Your class tag with JsonIgnoreProperties annotation and implements set & get: :

@JsonIgnoreProperties(ignoreUnknown = true)
public class ObjectBean {
    private String data;
    private ArrayList<ObjectDetailBean> objectDetailBeans;
    // need getters
    ...
}

In case attributes, they don't have to set a method, the reference stores null value.

Save a singleton object:

SharePreferenced.save(myObjectClass,MyClass.class);

Now, Save different objects by unique id tag:

SharePreferenced.save(myObjectClass,MyClass.class,"OBJ1");

4. License

by Romell Domínguez

Copyright 2016 Romell D.Z.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and limitations under the License.