Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; public class Main { public final static String AUTH = "authentication"; private static Context applicationContext = null; public static String GetNotificationRegistrationID() { SharedPreferences Prefs = PreferenceManager.getDefaultSharedPreferences(applicationContext); if (Prefs != null) return Prefs.getString(AUTH, ""); return null; } }