Skip to content Skip to sidebar Skip to footer

Android -how Do I Access Device Information Like Android Version Of The Device In My App?

In my app, I have an email button that uses an intent to open gmail app. How do I access the Android device version and the device model to include it in the body of the email?

Solution 1:

For the api info you can use below code.

int currentapiVersion = android.os.Build.VERSION.SDK_INT;
if (currentapiVersion >= android.os.Build.VERSION_CODES.FROYO){
   // Do something for froyo and above versions
} else{
   // do something for phones running an SDK before froyo
}

and for device maker information use below one

StringdeviceName= android.os.Build.MODEL;
 StringdeviceMan= android.os.Build.MANUFACTURER;

will find more info on system properties here Official doc - Build

Post a Comment for "Android -how Do I Access Device Information Like Android Version Of The Device In My App?"