Reusing Google Maps Cache?

Asked by At

While the user pan and zoom the map in my android app, google maps (Maps SDK for Android) natively stores tiles in the cache folder for performance reasons. Which allows the user to navigate the map offline, should she revisit the same places again (great!).

Unfortunately, the cache folder -- eventually -- get cleared by the system. Forcing the user to connect to the Internet to get access to the same tiles she used to visit (not great!).

When I list the files in getCacheDir() I get this file: com.google.android.gms.maps.volley Which I assume is the file used by google maps to store tiles. I tried to read it but with no luck.

My question is: Is it possible to copy this cache file to internal app storage? Then when the system clear the cache, the app copies the file back to the cache again?

If not possible, what are my alternatives?

0 Answers