Thursday, April 18, 2013

[android help] Using the android Google Maps API v2 as a viewer of offline tiles: is it possible?


The Google map component (com.google.android.gms.maps.GoogleMap) allows one to render custom tiles (OpenStreetMap or other). These tiles can be on the device and available offline which is what I am doing by extending TileProvider. Doing this in conjunction with a:



mMap.setMapType(GoogleMap.MAP_TYPE_NONE);


I am not pulling any data from Google map servers and the component can reasonably be expected to work without an internet connection. (I emphasize here that I am not trying to cache Google's data; I am working with offline tiles independently of Google's map servers.)


I thought everything was fine until I realized that the map component won't work if, when it is executed for the first time, the device is offline. In such cases I get a message:



failed to load map. could not contact google servers



I imagine the reason behind this is Google's API keys which require my app to authenticate in order for the component to be allowed to execute.


Can anyone confirm this is correct? What I would really like to be sure of is that provided that the component is executed once online, it will run ok afterwards. I must make sure that there are no time-out issues which would require the component to re-authenticate later on and which would basically make my app useless. That would require that I move on to some other component (such as OS Android).


Any light on this would be greatly appreciated. Even being pointed to the channel through which I could hope to get a reply from the google developers would be useful.


Thanks



.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...