@@ -0,0 +1,1206 @@
+package fr.tvbarthel.apps.simpleweatherforcast.utils;%0A%0A%0Aimport android.content.Context;%0Aimport android.content.SharedPreferences;%0Aimport android.content.SharedPreferences.Editor;%0Aimport android.preference.PreferenceManager;%0A%0Apublic class SharedPreferenceUtils %7B%0A%09private static String KEY_LAST_UPDATE = %22SharedPreferenceUtils.Key.LastUpdate%22;%0A%09private static String KEY_LAST_KNOWN_JSON_WEATHER = %22SharedPreferenceUtils.Key.LastKnownJsonWeather%22;%0A%0A%09private static SharedPreferences getDefaultSharedPreferences(final Context context) %7B%0A%09%09return PreferenceManager.getDefaultSharedPreferences(context);%0A%09%7D%0A%0A%09public static String getLastKnownWeather(final Context context) %7B%0A%09%09return getDefaultSharedPreferences(context).getString(KEY_LAST_KNOWN_JSON_WEATHER, null);%0A%09%7D%0A%0A%09public static long getLastUpdate(final Context context) %7B%0A%09%09return getDefaultSharedPreferences(context).getLong(KEY_LAST_UPDATE, 0);%0A%09%7D%0A%0A%09public static void storeWeather(final Context context, final String jsonWeather) %7B%0A%09%09final Editor editor = getDefaultSharedPreferences(context).edit();%0A%09%09editor.putString(KEY_LAST_KNOWN_JSON_WEATHER, jsonWeather);%0A%09%09editor.putLong(KEY_LAST_UPDATE, System.currentTimeMillis());%0A%09%09editor.apply();%0A%09%7D%0A%0A%7D%0A

Add SharedPreferenceUtils for future uses.