How can I detect pogrammatically whether a Google Map was actually loaded on Android with API v2 (e.g. when network is not available)?

不羁的心 提交于 2019-12-04 15:08:11

GooglePlayServicesUtil.isGooglePlayServicesAvailable is related to GooglePlayServices.APK available on your device. API will not give you any indication of when tiles are loaded.

You have the options to:

  1. check if any tiles are cached by trying (hackish, simplified): new File(getExternalCacheDir(), "cache_vts_your.package.name.0").exists()
  2. check internet availability with your own code
  3. parse logcat to find the error

Edit:

Note point 3 is deprecated because applications are not allowed to read logs anymore due to security reasons

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!