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_BC = "balloon_count"; public static void cacheBalloonCount(Context context, int count) { SharedPreferences sp = context.getSharedPreferences(CONFIG, Context.MODE_PRIVATE); sp.edit().putInt(KEY_BC, count).commit(); } }