Search code examples
androidgoogle-mapsgoogle-play-servicescompatibility

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


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.


Solution

  • 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.