Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.content.SharedPreferences; public class Main { public static final String IP_PORT = "ip_port"; public static final String CVALUE = "cvalue"; public static void putIpPort(Context context, String ip) { SharedPreferences preferences = context.getSharedPreferences(IP_PORT, Context.MODE_PRIVATE); preferences.edit().putString(CVALUE, ip).commit(); } }