OiO.lk Blog Android Caching API call data
Android

Caching API call data


I’m using Ktor to call API in my android app in kotlin and now I want to cache the response so that I can use app even if it is offline, how to do that ??

I have used HttpCache but that didn’t work

install(HttpCache) { val cacheFile = Files.createDirectories(Paths.get(System.getProperty("java.io.tmpdir"), "ktor_cache")).toFile() publicStorage(FileStorage(cacheFile)) }



You need to sign in to view this answers

Exit mobile version