In my application, I need to check Google Play services version (which is installed in user's device). Is it possible ? And if yes, how can I do that?
Google Play Game Service will be stopped if Google Play Service is stopped and uninstalled. You may also lose your progress in the game if you use it to sync and save your game data. Also Read: How to Check Phone Processor [Android, iOS] ?
Google Play services helps to ensure the security and reliability of an Android device, and keep devices updated with the latest security features. This includes: Google Play Protect, which can warn users if an app contains known malware.
I found simple solution:
int v = getPackageManager().getPackageInfo(GoogleApiAvailability.GOOGLE_PLAY_SERVICES_PACKAGE, 0 ).versionCode;
But versionCode
is deprecated in API 28, so you can use PackageInfoCompat
:
long v = PackageInfoCompat.getLongVersionCode(getPackageManager().getPackageInfo(GoogleApiAvailability.GOOGLE_PLAY_SERVICES_PACKAGE, 0 ));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With