38

how to get the android phone model, version, sdk details?

jaks
  • 4,407
  • 9
  • 53
  • 68

4 Answers4

90

First of all, have a look at these "Build" class at android-sdk page: http://developer.android.com/reference/android/os/Build.html.

// Device model
String PhoneModel = android.os.Build.MODEL;

// Android version
String AndroidVersion = android.os.Build.VERSION.RELEASE;
Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295
  • Thanks for help . I tried it very long but could not find this answere .So thanks for help and i am granting +1 for great help –  Dec 22 '11 at 06:40
  • 2
    @Aditya1510 Thand and glad that my answer is helpful to you. :) – Paresh Mayani Dec 22 '11 at 06:41
14
 String s = "Debug-info:";
 s += "\n OS Version: " + System.getProperty("os.version") + "(" + android.os.Build.VERSION.INCREMENTAL + ")";
 s += "\n OS API Level: " + android.os.Build.VERSION.RELEASE + "(" + android.os.Build.VERSION.SDK_INT + ")";
 s += "\n Device: " + android.os.Build.DEVICE;
 s += "\n Model (and Product): " + android.os.Build.MODEL + " (" + android.os.Build.PRODUCT + ")";

Example output:

 OS Version: 4.9.106-perf+(1909112330)
 OS API Level: 9(28)
 Device: OnePlus6
 Model (and Product): ONEPLUS A6000 (OnePlus6)
azizbekian
  • 60,783
  • 13
  • 169
  • 249
Ajay
  • 4,850
  • 2
  • 32
  • 44
2

You can use Build.MODEL and Build.VERSION

0

I recommend open library "Caffeine", This library contain get Device Name, or Model, have SD Card check, and many features.

this library is here.

https://github.com/ShakeJ/Android-Caffeine-library

And you use 'SystemUtil' example,

SystemUtil.modelName();
ShakeJ
  • 633
  • 5
  • 10