How to implement google maps with best possible backward compatibility in an android?

前提是你 提交于 2019-12-13 05:51:16

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/37476987/how-to-implement-google-maps-with-best-possible-backward-compatibility-in-an-and

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