package com.offline.music.playermp3.firebase;

import android.content.Context;
import android.content.SharedPreferences;



public class Sp {

    private static String spName = "AD_SHOW";
    private static Sp instance;
    private SharedPreferences.Editor editor;

    private SharedPreferences preferences;

    private Sp(Context context) {
        preferences = context.getSharedPreferences(spName, Context.MODE_PRIVATE);
        editor = preferences.edit();

    }


    public static void init(Context context){
        instance = new Sp(context);
    }

    public static Sp getInstance() {
        return instance;
    }


    public Sp putStringValue(String key, String value) {
        editor.putString(key, value);
        return this;
    }

    public boolean commit() {
        return editor.commit();
    }

    public String getStringValue(String key) {
        return preferences.getString(key, RemoteConfigJava.value_open_type_0);
    }
}
