title: How do I determine the actual build number for Google Play Services on Android?
body: <p>NOTE:  I am not trying to update google play services in the emulator.  I do not care that it is out of date.  I mentioned it only to show that somehow logcat is reporting the actual build number, which I wish to access in the app.</p>
  
  <p>Similar, but not the same as, <a href="https://stackoverflow.com/questions/28512016/how-can-i-determine-the-version-of-google-play-services">How can I determine the version of Google Play services?</a></p>
  
  <p>An app I'm developing using Android Studio 1.2.2 is experiencing a problem if the latest Google Play Services is not installed on the device, yet GoogleApiAvailability is not reporting a problem and so the code instructing the user to update is never called.  If I manually tell the users to update play services in the play store with a manual link to <a href="https://play.google.com/store/apps/details?id=com.google.android.gms&amp;hl=en" rel="nofollow noreferrer">https://play.google.com/store/apps/details?id=com.google.android.gms&amp;hl=en</a>, there is an update available, and the app functions correctly after they install it.</p>
  
  <p>However I am unable to find a way to determine that the user needs to update via application code or the gradle build file.</p>
  
  <ol>
  <li><p>In the gradle file I've specified: compile 'com.google.android.gms:play-services:7.5.0' and this is the latest version as far as I know.  Android Studio does not indicate that I should update this line to a newer version.</p></li>
  <li><p>The SDK manager reports the play services I have installed is "rev 25", and no update is available.</p></li>
  <li><p>When I test in an emulator, the code works correctly, and in logcat I see the message: "W/GooglePlayServicesUtil:  Google Play services out of date.  Requires 7571000 but found 6774470".  This is normal for the emulator since they haven't released new images yet, but it provides an interesting clue.</p></li>
  </ol>
  
  <p>Is there a way to get this build number reported in item 3 above, programatically?  If so, I could compare against that rather than using the isgooglePlayServicesAvailable method of GoogleApiAvailability -- which I'm already using, but is reporting success on devices that need an update.</p>