9

Can anybody tell me why we need to mention the Google Play service's version in an app's manifest? What does Android do with this value?

elixenide
  • 44,308
  • 16
  • 74
  • 100
Jitendra Prajapati
  • 1,002
  • 1
  • 10
  • 33

4 Answers4

4

Google continuously upgrading it's play service.But as old applications are there, so to support applications which are using old version of play service we need to spacify on what version of play service our application based.

Update:

we include google-play-service lib and the version is based on this lib not on google play service installed in our mobile. so play-service-lib jar will always be inside in our application with it's version code.So google will manage google play service request according to play-service-lib version.

we provide version of google-play-service lib in our manifest

<meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

and "@integer/google_play_services_version" refers to version of Lib,which is using in our application.

This is just like, We request Facebook installed application or we use Facebook Sdk with our application..Both are different things.

Hope it is clear..

Vibhor Bhardwaj
  • 3,071
  • 5
  • 28
  • 49
  • Hello Vibhor thanks for your answer but I think if you are right then after update of google play services app should not work because google play service has been updated and thing inside google play service has been changed. so Google play service of specified vesrion in androd mainfest of your app will not found on your devices. – Jitendra Prajapati Feb 21 '14 at 05:40
  • If it is not depend on google play service installed on device then why we check it in out code that whether google play services is installed or not in phone.In some devices it shows that google play services are not installed on your devices in case when devices have not google play services latest version installed. – Jitendra Prajapati Feb 21 '14 at 06:40
  • We check google play service to know the compatibility of our device. We Check whether our application can support google play service provided by google or not.If play service is available in device then our device can run any application which is using google play service,doesn't matter which version of Lib we are using. – Vibhor Bhardwaj Feb 21 '14 at 06:45
2

This is because latest google play services requires a version name, which is to be mentioned using <meta-data .. /> inside AndroidManifest.xml.

Update:

Sometimes you have the need to set up some app-wide configuration information in an Android app or need to create a class that can be used in multiple projects with a generic way of setting configuration values. This is particularly useful for things like API keys that will probably be different across apps but should be accessible in the same way. There are several ways to do it, but the one I’ve come to prefer is adding a meta-data tag to the AndroidManifest.xml file. If you are familiar with Android Admobs , New Relic Application Tools, Chartboost, InMobi, Millennial, Google Play Store and most of them are using meta-data for this.

M D
  • 47,665
  • 9
  • 93
  • 114
  • 1
    Its ok but why we need to mention this ? what does android do with this ? – Jitendra Prajapati Feb 21 '14 at 05:49
  • ok mentioning app wide configuration information in android app is done by metadata tag easily but My question is that why we add google play services version in mainfest file of our app. what android does with this – Jitendra Prajapati Feb 21 '14 at 06:45
  • @user2130718 read my answer carefully and you got your answer.This is particularly useful for things like API keys that will probably be different across apps but should be accessible in the same way for the your particular app. – M D Feb 21 '14 at 06:49
  • I think your are showing way of passing configuration information to parent component. but My question is for what purpose we are passing this information (Google play services version )to parent component (Activity) in our app . why we need to pass this version to parent activity ? – Jitendra Prajapati Feb 21 '14 at 07:40
2

Using the version , Google Play Store keeps a track of the number of updations done to the application and .apk file uploaded to the Developer's Console . This is applicable after the application has been Published in the Google Play Store.

If any modification is done to the application and you want to upload the .apk file to the Developer's Console to distribute it to the user , you have to change the version . Else you would not be able to upload the .apk file.

Also upgrading the version notifies the users about any changes/modifications/upgradations done the published application in the Google Play Store.

Aparupa Ghoshal
  • 309
  • 2
  • 10
  • I want to know in the context of google play service version in my Application's mainfest file in which google palay service lib has been added. – Jitendra Prajapati Feb 21 '14 at 05:13
  • Yes this is valid reason `Google Play Store keeps a track of the number of updations done to the application` – Lucifer Feb 21 '14 at 05:14
  • 1
    Ok but I am talking about google play services version in mainfest file not a app version. your reason is good only for your app when you publish it. – Jitendra Prajapati Feb 21 '14 at 05:22
0

it is helpful to know that which version is currently in use and to decide the behavior according for the google play services, we need to mention google play lib version at manifest which can be done with meta data tags of xml in android manifest.

please visit http://developer.android.com/google/play-services/index.html

it is basically of Google Play Store keeps a track of the number of updations done to the application and beside this

1)Google Technology

2) For Standard Authorization

3) Tracking versions and api uses and to track and know Automatic Updates

please visit in support of the discussion

http://arstechnica.com/gadgets/2013/09/balky-carriers-and-slow-oems-step-aside-google-is-defragging-android/

http://google.about.com/od/p/a/What-Is-Google-Play.htm

Jitesh Upadhyay
  • 5,244
  • 2
  • 25
  • 43