Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.content.SharedPreferences; public class Main { private static final String CONFIG = "config"; private static final String KEY_BD = "balloon_duration"; public static final long DEFAULT_FLY_DURATION = 2500; public static long flyDuration(Context context) { SharedPreferences sp = context.getSharedPreferences(CONFIG, Context.MODE_PRIVATE); return sp.getLong(KEY_BD, DEFAULT_FLY_DURATION); } }