caching - Android HttpResponseCache, can i use that cache data? -
I searched this on the web but was unable to find an answer.
Caching: Private Zero Passive HTPRPS PACCACH (File Cache Dior)
{/ p>
{long httpCacheSize = 10 * 1024 * 1024]; // 10 MiB file httpCacheDir = new file (cache directory, "http"); Class.forName ("android.net.http.HttpResponseCache") .getMethod ("Install", File Category, Long.) Evanoc (Blank, httpCacheDir, httpCacheSize); I have seen 3 files in the files that I created in the file:
- e8b34557a3241feb7e186d1b86c9af4c.0 < / Li>
- e8b34557a3241feb7e186d1b86c9af4c.1
- Magazine
and the file e8b34557a3241feb7e186d1b86c9af4c.1 contains my JSON data.
A way to obtain and use that data? Look at
HTTPResponsecache . You can force a cash response! Try
// {connection.addRequestProperty ("cache-control", "only-if-cached"); Inputstream cached = connection.getInputStream (); // Resource was cached! To show this (FileNotFoundException e) {// Source was not cached}
Comments
Post a Comment