Google Play Service , Using Updated Google Map V2 - android

i am using google play services in my project, i am trying to use google map v2 service in my app.
For this i included play services as dependency in build.gradle file as mentioned in this thread.
for now the latest version of play services is 3.2.65 and i am pointing to it. Ok.
So my question is ,In the future when google releases newer version of play services and the device has play services version above 3.2.65 which was specified in build.gradle file, will cause any problem or not? And will my application adapts the latest feature of play services automatically or i have to release updates of my application every time google releases newer version of play services.
And if not then is there any other way or including play services in module dependency so that my application will always use updated version of play services.
Thanks

My guess is you have to recompile your project with a newer version of the library.
Various library versions are downloaded on your machine and used to compile the project.
SDK_DIRECTORY/extras/google/m2repository/com/google/android/gms
Of course Google releases things in order to preserve compatibility, so if you don't need any new feature/API you don't have to update your project.
In your build.gradle file, you can also write in this way:
compile 'com.google.android.gms:play-services:3.1.+'
So you will pick up any new 3.1.x version whatever is the latest number.

In the future when google releases newer version of play services and the device has play services version above 3.2.65 which was specified in build.gradle file, will cause any problem or not?
No, it won't cause any problems. Google Maps Android API v2 is developed in a forward-compatible way. No change will ever be made that can break older apps.
And will my application adapts the latest feature of play services automatically or i have to release updates of my application every time google releases newer version of play services.
Depends. Most of the bug fixes are made in the Google Play Services app and you don't need to update client library. Because client library has almost no code, there is low chance any bug will appear there.
If you want to use new features, you will obviously have to update the library to be able to call new APIs.

Related

How to resolve Google Play Services library dependency with minimum required version

I am trying to include a SMS feature from Google play services support libraries to improve the authentication process. The documentation around it recommends using atleast minimum of 10.2 play services in order to use it.
Prerequisites:
The SMS Retriever API is available only on Android devices with Play services version 10.2 and newer.
However, when I go to build my project specifying the 10.2.0 version of in gradle, Android studio tells me it is unable to resolve this dependency from either jcenter or google's repos.
compile 'com.google.android.gms:play-services-auth-api-phone:10.2.0'
Error:org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.google.android.gms:play-services-auth-api-phone:10.2.0.
I tried searching for the package, but couldn't find that version: google's maven repos only show 11.0 and above.
It would be really helpful if someone could point me to the minimum available version of play services libraries over 10.2 that can be used to make this work.
Versions of Google Play services prior to 11.0.0 are only available through the SDK Manager. Make sure you have installed the Google Play services item in the SDK Tools tab of the SDK Manager.
However, in the case of the SmsReceiverClient API, that class was only added in Google Play services 11.0.0 SDK. It may be that the underlying implementation did exist back to 10.2, but was not public.
In any case, Google Play services releases an SDK only after it is made available to all users and will automatically update the vast majority (99.5%+) of users within the first week or two of availability. Given that 11.0.0 has been available for over 6 months, it should not be any issue in relying on the 11.0.0 library.

How to decide which version of Google Play services to use?

I am working on an Android application which supports Android version 14 and above. I have compiled my application against Android version 21.
I have used Google Play Services 7.0.0. The application works fine on Android 21. But when I run the application on Android version 19, it throws the following exception
Google Play services out of date. Requires 7095000 but found 6183036
So, I want to know what should be the version of Google Play that I should include in my application so that it works fine on Android 14 and above.
I think you are trying to find an answer to your question using a wrong approach.
The version of the Google Play Services that you want to include depends on the APIs your application implements. Picking a version based on the device you want to support will affect your application performance in a negative way.
Nearby Connections API, Places API are added in the Google Play services 7.0. If your application is using any of those or other APIs added in this version of Play Services then, these features may not work if you specify a lesser version in the Gradle files.
Similarly, Mobile Vision API, Nearby Messages were introduced in the Google Play Services version 7.8. There is no way you can implement them by including an earlier version of Play Services even if you want to support Android 2.3 devices.
Maps and Location Based Services services had been updated in many Play Services versions. Each update has added a small feature to it and improved overall battery efficiency, responsiveness. The version number you are using will affect the battery life ...
In every update to the Google Play Services existing versions, new APIs are released and old ones are improved. Consider the APIs your application is implementing then decide which version of the Play Services you want your users to update so that they can use your application smoothly.
Many Android users regularly update their Google Play Services. Even if the user has a KitKat device or Ice Cream Sandwich they could have updated their Google Play Services to the latest 7.8 version or to an intermediate version.
You can change the minimum sdk version in gradle(app) file to run your application in lower versions of android.

Maximizing Google Play Services Backwards Compatibility

What are the recommended practices for maintaining the widest backwards compatibility of an Android app while depending on Google Play Services?
The developer implementation documentation for using Android Studio indicate compiling against v5.+
compile 'com.google.android.gms:play-services:5.+' which with the available downloads I'm using seem to end up using version 5208000. At which point I get errors and warnings returned while testing an application:
W/GooglePlayServicesUtil Google Play services out of date. Requires 5208000 but found 5089036
E/GooglePlayServicesUtil GooglePlayServices not available due to error 2
Admob, my dependency on Google Play Services, appears to work normally however. If you follow the Google recommendation to call isGooglePlayServicesAvailable() and GooglePlayServicesUtil.getErrorDialog(), the user is told an upgrade is required for the app to work and sent to the store where there is no update available.
In other places maintaining backwards compatibility means compiling against the oldest API version that supports the features you need. So I tried with v4 compile 'com.google.android.gms:play-services:4.+' which generated another error:
E/GooglePlayServicesUtil﹕ The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
Searching around indicates this is a false report and can be ignored.
If I compile against a newer API version and it's not present on the device will things work? Or do I have to coax users into upgrading? Is it better to compile against an older API version and assume that things are properly backwards compatible with newer versions running on devices?
I'm the developer of an SDK that optionally depends on Google Play Services, and my approach has been, as you mentioned, to compile against the oldest version of Google Play Services that contains the APIs that I need, such that downstream clients won't into issues like these.
If the APIs that you need are available in v4, it's safe to compile against com.google.android.gms:play-services:4.+, and to follow Google's directions to show a prompt to a user to upgrade. Users will only see the upgrade dialog if they're running an older version of v4, or if they're somehow still on v3. In either case, the upgrade dialog should correctly lead them to the Play Store, where there will indeed be an upgrade available.
If the APIs that you need are only available in v5, do not use a wildcard version (ie 5.+). You should compile against an older version that is likely to be widespread, such as com.google.android.gms:play-services:5.0.89. Using a wildcard means you'll compile against the very latest version of Google Play Services that you've installed in the Android SDK manager, on whatever computer/environment you happen to be compiling on, which to me just feels wrong - I don't care if it's Google building the library, I like to know exactly what I'm compiling into my app.
Moreover, with a wildcard, if you always keep your SDK manager updated, whenever you compile the release version of your app and then push it to Google Play, you may have just shipped an app against a version of Play Services that isn't widespread, or worse - isn't even available for download on every device yet, in which case users will get the dialog and not be able to upgrade, as you've seen during development.

Differences between google play services client and google play package version

i notice this into my logcat:
I/Google Maps Android API(2924): Google Play services client version: 5089000
I/Google Maps Android API(2924): Google Play services package version: 5089034
i know that these are two different versions of google play services.Can someone tell me the differences between these version?
Should their version be the same?
Package version : Is what you add to your project. (Google play service Lib)
client version : Is the actual version of the google play services installed in your phone.
I wouldn't say that you should always have the "latest" version supported. For example, if you do something like this in build.gradle
compile 'com.google.android.gms:play-services:+'
it will use the latest package version available. But sometimes, an update is released through the sdk to developers much before its counterpart client version hits the Play Store. #Cimat, I believe this reason behind the problem you had. Staying only as updated as the available client version ensures crashes don't happen, while providing you with the upgrades. Android automatically updates the Google Play Services jar anyways, so you need not worry about user laziness.
#amalBit, you're wrong.
client version is what you've added to gradle dependencies.
Package version : Is the actual version of the google play services installed in your phone.
client version : Is what you add to your project. (Google play service Lib)

Google Play Service library in Android

Hello I am trying to use google-play-services_lib in my android project. As you know in android phone there is Google Play Service APK which provide a some features to you such as location fetching etc.
So I have confusion that Suppose user have Google Play Service APK version is 4.3 and I am using Google Play Services library version is 4.0.30 in android project to build the app.
Do we require same version on both side like build with same latest Google play service library and Google Play Services installed APK to make as like Push Notification, Location fetching work in this case or there is no link between them ?
Thanks in advance
They don't have to match.
The development of the library and the application is not completely dependant, that's why thier version number is different. As far as I know, each release of the services apk defines a maximum version of the library that is supported. So the only conflict could happen when the services apk is outdated (on the target device), and your application's library is a newer one.
The best you can do is to update the library, and the services application on your device.
It should work that way.
I dont think so that there is link between APK and supported libraries in that because the APK silently gets updated about libraries

Categories

Resources