Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.content.Context;
import android.content.SharedPreferences;

public class Main {
    private static final String STORE_NAME = "TestStore";
    private static final String STORE_KEY_PREFIX = "TESY_STORE_";

    public static long readLong(Context context, String key, long defaultValue) {
        SharedPreferences pre = context.getSharedPreferences(STORE_NAME, Context.MODE_PRIVATE);
        return pre.getLong(STORE_KEY_PREFIX + key, defaultValue);
    }
}