Java tutorial
//package com.java2s; import android.content.Context; import java.io.File; public class Main { private static final int CACHE_TIME = 60 * 60000; public static boolean isCacheDataFailure(Context context, String cacheFile) { File data = context.getFileStreamPath(cacheFile); return !data.exists() || (System.currentTimeMillis() - data.lastModified()) > CACHE_TIME; } }