Java tutorial
//package com.java2s; import android.app.Activity; import android.content.Context; import android.content.SharedPreferences; public class Main { private static final String SHARED_PREF_CACHED_KEY = "cache_file_name"; /** * Tests if the json has been cached locally * * @return True if the file has been cached */ public static boolean wasJsonCached(Activity activity) { SharedPreferences sharedPreferences = activity.getPreferences(Context.MODE_PRIVATE); return sharedPreferences.contains(SHARED_PREF_CACHED_KEY); } }