0

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?

Sammys
  • 1,443
  • 5
  • 14
  • 21

1 Answers1

0

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

 String deviceName = android.os.Build.MODEL;
 String deviceMan = android.os.Build.MANUFACTURER;

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

Community
  • 1
  • 1
dora
  • 2,047
  • 3
  • 18
  • 20