android cache 사용하기
android cache 사용하기 --------------------------------------------------- import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import android.content.Context; public class CacheStorage { private static String _cacheFileName = "cache"; private static Context Ctx; public CacheStorage(Context ctx, String cacheFileName){ if(cacheFileName != null && cacheFileName.length() > 0) _cacheFileName = cacheFileName; } public void setCacheFile(String data) throws IOException{ setCacheFile( _cacheFileName, data); } public void setCacheFile(String cacheFileName, String data) throws IOException{ if(cacheFileName == null || cacheFileName.length() < 1) cacheFileName = _cacheFileName; try { File cacheDir = Ctx.getCacheDir(); File cacheFile = ne...
댓글
댓글 쓰기