offline-caching
Offline mode for Android app using the Google Maps API
See this solution or this one. Basically you just create your own tileprovider and access tiles locally. It is totally doable with the v2 API. API Reference There’s some false information floating around out there that the v2 Google Maps API requires an Internet connection. There was a but where the API would require a … Read more
How to properly invalidate an HTML5 Cache Manifest for online/offline web apps?
I think I’ve got this figured out: if there’s an error in one’s cache-manifest (say, a referenced file does not exist), then Firefox completely will stop processing anything applicationCache related. Meaning, it won’t update anything in your cache, including your cached cache-manifest. To uncover that this was the issue, I borrowed some code from Mozilla … Read more
Why use a service worker for caching when browser cache handles the caching?
Service Workers give you complete control over network requests. You can return anything you want for the fetch event, it does not need to be the past or current contents of that particular file. However, if the HTTP cache handles your needs, you are under no obligation to use Service Workers. They are also used … Read more
Can Retrofit with OKHttp use cache data when offline
Edit for Retrofit 2.x: OkHttp Interceptor is the right way to access cache when offline: 1) Create Interceptor: private static final Interceptor REWRITE_CACHE_CONTROL_INTERCEPTOR = new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { Response originalResponse = chain.proceed(chain.request()); if (Utils.isNetworkAvailable(context)) { int maxAge = 60; // read from cache for 1 minute return originalResponse.newBuilder() … Read more