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 DEVICEID = "deviceid"; public static final String DEVICE = "device"; public static void editDeviceId(Context context, String deviceId) { SharedPreferences preferences = context.getSharedPreferences(DEVICE, Context.MODE_PRIVATE); preferences.edit().putString(DEVICEID, deviceId).commit(); } }