caching - how can i implement offline storage in android using cache? -


hi want implement offline storage in android using cache( kinvey api)?can share step wise implementation same?i searched lot don't information android cache.

   cache cache = appcontroller.getinstance().getrequestqueue().getcache();             cache.entry entry = cache.get(api);             if (entry != null) {                 try {                     string data = new string(entry.data, "utf-8");                     jsonobject jobj = new jsonobject(data);                     filewriter file = new filewriter(cxt.getfilesdir().getpath() + "/" + filename);                     string jsonstring = jobj.tostring();                     file.write(jsonstring);                     file.flush();                     file.close();                   //  preparelistdata(jobj);                 } catch (unsupportedencodingexception e) {                     e.printstacktrace();                 }             } 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -