Update Google Play services for an old app - android

I have an old app which uses Google play services 5.08. Since the app uses kiosk mode, we never updated google play services on the device. Now I have to update the google play services to 8.4. I also want the already existing users to use the app without getting crashes. So how do I support both of 5.08 and 8.4 APIs to support in the app? I see Google doesn't expose the APIs of 5.08 when I use 8.4 in Gradle file.

Create a newer version of the app that will use the latest google play service(8.4). Retain the older version of the app for the current google play service(5.08).
The version of the Google Play Service will depend on the APIs your application implements. Supporting both google play service in an app will affect your application performance in a negative way or it is not applicable. Every update of Google Play service adds new APIs connected and older APIs improved. Consider the APIs your application will implement, then decide which version of google play services should your user update to have a smooth running application.
The Google Play services client
library
The client library contains the interfaces to the individual Google
services and allows you to obtain authorization from users to gain
access to these services with their credentials. It also contains APIs
that allow you to resolve any issues at runtime, such as a missing,
disabled, or out-of-date Google Play services APK. The client library
has a light footprint if you use
ProGuard as
part of your build process, so it won't have an adverse impact on your
app's file size.
If you want to access added features or products, you can upgrade to a
new version of the client library as they are released. However,
upgrading is not necessary if you don't care about new features or bug
fixes. We anticipate more Google services to be continuously added, so
be on the lookout for these updates.

Related

How to decide on the version of google play services to use in the application when using any google play services api?

We are going to integrate Google SignIn (by replacing Google Plus Login). For Google SignIn the minimum google play services version required is 8.4. If I go by the documentation of Google, then they have mentioned using version 9.2.1. But a lot of our app users are on slow connection networks and since 9.2.1 is relatively new, it is possible that a lot of these users will not have this update installed on their devices. So my question is that for any api which requires google play services, which version to use?
1) The latest version (9.2.1 in the case of Google signin) - Google suggests to use the latest version because it has bug fixes. But again, if I use the latest version, then some of my users can miss this functionality. Here I can check the google play services version and prompt the user for update (Not sure if all the users will update).
2) Minimum version (8.4 in the case of Google signin) - Now since this is a minimum version required, more number of users will have this version installed on their devices.
So, what is the best way to decide on the version when using any of the
Google Play services api?
P.S. I understand that Google Play services update happens every few days, and most of the users will have the updated services. But my concern is for those users, who are on a slow network connection. Because I can achieve the same functionality by just using a lower version of Google Play Services.
I think it is always good to go with latest versions, but if you have any other concerns you can use the older Google Play Services.
And As far as I know Google Login com.google.android.gms:play-services-auth:8.4.0.
You can use play-services-auth:8.3.0 also with help of google-services:2.1.2,
classpath 'com.google.gms:google-services:2.1.2'
compile 'com.google.android.gms:play-services-auth:8.3.0'
But remember you need to use all other play services should compatible with google-services:2.1.2 and all dependencies should have the same version (8.3.0).

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

Google maps API use on a device with no google services license

Let's say i have an xaiomi device that doesn't have a license for using google apps(Google App Services) but only have the android system on it(hence the device is suppose to be more cheap). So is an app that uses a google map services can be used in the device?
No. When you try using the Play Services SDK, it will look for the Play Services Framework and not find it and give you some sort of unrecoverable error.
Your choices are:
Build the app using something other than Play Services (e.g., OpenStreetMap or MapBox for maps instead of Maps V2).
Use different product flavors of your app for different distribution channels (e.g., a google flavor for distribution through the Play Store and an other flavor for distribution outside of the Play Store). You can use Play Services in the Play Store flavor and use some alternative for the non-Play Store flavor. This is more work, but if you feel that the Play Services results will be much better for the user, it may be worth the effort.

How to run Android app with old version of Google Play Services library?

I have the legacy application which actively use "com.google.android.gms.location.LocationClient" but in the new GooglePlayServices version there is no such class!! https://developer.android.com/google/play-services/index.html "...If you were previously using LocationClient, call the APIs in the com.google.android.gms.location package instead..." said there.
As I understand there is no option to force an old version of Google Play Services with custom application on the device, am I wrong?
Does it mean that I should rewrite some portion of application?
Is there any method to run app with old version of Google Play Services library on the device?
All Google Play Services are backward compatible - as long as you compile with Google Play Services 6.1 or below, you can continue to use LocationClient.
However, that does mean you will not get any of the new APIs, performance improvements, or other features available only in the newer versions of Google Play services so you should definitely consider moving over to the new API as soon as possible.

Google Play Services with AdMob. Check availability?

I'm in the process of migrating from AdMob SDK to Google Play Services. I've done most of the job and things seem to be working fine, but I'm not sure I understand the logic behind some of the interaction.
The changes I've made can be found here: Google Play Services Migration.
When am I utilizing Google Play Services with my new code? The site "Set up Google Play Services SDK" states that your app should verify the version available before attempting to perform API transactions. However, when running my app on an emulator that does not have Google Play Services, I am still able to fetch an ad using an AdView and AdRequest.Builder(). I do however note the LogCat warning Google Play services is missing.. How can the ad still be showing?
Also, will the Google Play Services referenced library be included in the APK export, or is this just for the development environment?
Google Play Services consists of two components. One is the jar linked to the app and the other is part of the system (Android OS). The AdMob ad display component is in the jar while other play services are in the system.
If a app is built with Google Play Services you will have the ability to display AdMob ads, but you won't get some of the other Google Play Services features.
So yes, when your app is linked to the library some Google Play Service classes will be included in your APK.
It is also possible to display AdMob ads by using the older (now deprecated) AdMob SDK.

Categories

Resources