且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Android中以***的向后兼容性实现谷歌地图?

更新时间:2023-09-12 09:33:22

保持Android最大向后兼容性的推荐做法应用程序,而这取决于Google Play服务?

以下是我可以汇总的关于向后兼容性的指针,包括使用Google Play服务的指针。 p>


  1. Google Maps Android API 使用OpenGL ES版本2 来渲染地图。支持此功能的最少Android API版本是 API 8或Android 2.2 a>。

  2. 针对包含您需要的API的最早版本的Google Play服务进行编译。如此主题中进一步讨论的,请避免使用通配符,如5. +,因为该更新到最新的播放服务。请使用com.google.android.gms:play-services:5.0.89等广泛使用的版本。

  3. 使用V4支持库来验证和请求权限。


    com.android.support:support-v4:23.0.1



    您也可以通过 SO线程


    I'm building a simple android app that uses Google maps api to display map and navigation. As you may know Google maps need Play services Library to run on client android phone. i want my app to run in much older android OS's(14,15,..) Problems:

    1- Clients need to install or activate Play services app.

    2- then Clients have to update play services app to the latest version to use my app with google maps.

    3- how to make app to run in older androids? just by specifying min sdk ?

    so in order to solve first and third problem i've no idea but for the second one : building project with older Play service dependencies may help but i dont know how to do this or even it helps or not.

    it'll appreciate if guys offer any solutions ! Thank you all.

    What are the recommended practices for maintaining the widest backwards compatibility of an Android app while depending on Google Play Services?

    Here are the pointers I was able to aggregate concerning backwards compatibility, including those that use Google Play Services.

    1. The Google Maps Android API uses OpenGL ES version 2 to render the map. The least Android API version that has support for this is API 8 or Android 2.2 .

    2. Compile against the oldest version of Google Play Services that contains the APIs that you need. As further discussed in this thread, refrain from using wildcards like 5.+ because that updates to the latest play services. Instead use a widely used version like com.google.android.gms:play-services:5.0.89.

    3. Use the V4 support library to verify and request permissions.

    com.android.support:support-v4:23.0.1

    You might also check some additional insight from this SO thread.