1

I want to check within my app whether the device runs the latest version of Android.

Is there a way to do that?

Yes, I could update my app once a year, but I would rather solve that problem technically.

CarHa
  • 1,148
  • 11
  • 31
  • The [minimum `targetSdkVersion`](https://support.google.com/googleplay/android-developer/answer/113469#targetsdk) goes up every year, so you should be doing updates every year anyways. – ianhanniballake Jun 14 '19 at 03:25
  • 5
    Unless you want to create a webservice that publishes the version number of the latest Android and query it, no. There's no way to no without a service publishing it what the latest Android is. And even if you did, nobody ships stock Android- they all cherry pick additions and all use different minor build releases. So you could at most know if it was the right major version – Gabe Sechan Jun 14 '19 at 03:29
  • Why do you even want to do this? – John Dvorak Jun 14 '19 at 03:49

2 Answers2

0

Try to add this and check

String androidOS = Build.VERSION.RELEASE;

And also following method will work

int version = Build.VERSION.SDK_INT;
String company = Build.MANUFACTURER;
String model = Build.MODEL;
String release = Build.VERSION.RELEASE;

Log.e("TAG", "company " + company)
Log.e("TAG", "model " + model)
Log.e("TAG", "version " + version)
Log.e("TAG", "release " + release)
Udara Abeythilake
  • 1,215
  • 1
  • 20
  • 31
0

Comment from Gabe Sechan:

Unless you want to create a webservice that publishes the version number of the latest Android and query it, no. There's no way to no without a service publishing it what the latest Android is. And even if you did, nobody ships stock Android- they all cherry pick additions and all use different minor build releases. So you could at most know if it was the right major version

CarHa
  • 1,148
  • 11
  • 31