Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; public class Main { public static final String PREFERENCES_PLAY_RESOLUTION = "play_resolution"; public static final String KEY_PLAY_RESOLUTION = "key_play_resolution"; public static void setResolution(Context ctt, String resolution) { if (ctt != null) { SharedPreferences sp = ctt.getSharedPreferences(PREFERENCES_PLAY_RESOLUTION, Context.MODE_PRIVATE); sp.edit().putString(KEY_PLAY_RESOLUTION, resolution).commit(); } } }