Reputation: 319
I need to know Google Play Services Version on some devices.
After googling and searching stackoverflow, I found following two ways and tried these.
A. use PackageInfo
getPackageManager()
.getPackageInfo(GoogleApiAvailability.GOOGLE_PLAY_SERVICES_PACKAGE, 0 )
.versionCode;
B. use GoogleApiAvailability directly.
GoogleApiAvailability.GOOGLE_PLAY_SERVICES_VERSION_CODE;
I got results but results are different value.
result:
A: 12673023
B: 11717000
On the device, Settings -> Apps & Notification -> Google Play Services, version shows 12.6.73.
It seems A is correct.
On the other hand, B is simple and latest way.
Why is this two are different? which one is correct value? Everyone knows?
Upvotes: 0
Views: 444
Reputation: 1992
GoogleApiAvailability.GOOGLE_PLAY_SERVICES_VERSION_CODE
is the minimum required by your app, not the version installed
Upvotes: 3