Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android device information

Tags:

android

Is there an API for programmatically extracting information regarding the current Android device? For example, properties like "model", "OS" etc.

This would be an analogue of iOS's UIDevice class and instance properties.

like image 313
SK9 Avatar asked Aug 16 '11 06:08

SK9


People also ask

How do I find my Android device info?

Navigate to the app > res > layout > activity_main. xml and add the below code to that file. Below is the code for the activity_main. xml file.

How do I find my device information?

Android. To find your device's serial number in the software, go to Settings > System. Then jump into About Phone > Status.

What is Android device info?

Device Info is a simple and powerful Android application which gives you complete information about your Mobile device with advanced user interfaces.

What are device details?

Device Info – Displays device details such as organization group, location, smart groups, serial number and other identifying labels, power status, storage capacity, physical memory, warranty information, last reboot time (Android only), and device tags in alphabetical order.


2 Answers

Try This:

String _OSVERSION = System.getProperty("os.version");
String _RELEASE = android.os.Build.VERSION.RELEASE;
String _DEVICE = android.os.Build.DEVICE; 
String _MODEL = android.os.Build.MODEL; 
String _PRODUCT = android.os.Build.PRODUCT; 
String _BRAND = android.os.Build.BRAND; 
String _DISPLAY = android.os.Build.DISPLAY; 
String _CPU_ABI = android.os.Build.CPU_ABI; 
String _CPU_ABI2 = android.os.Build.CPU_ABI2; 
String _UNKNOWN = android.os.Build.UNKNOWN; 
String _HARDWARE = android.os.Build.HARDWARE;
String _ID = android.os.Build.ID; 
String _MANUFACTURER = android.os.Build.MANUFACTURER; 
String _SERIAL = android.os.Build.SERIAL; 
String _USER = android.os.Build.USER; 
String _HOST = android.os.Build.HOST;

More info at http://developer.android.com/reference/android/os/Build.html

like image 129
Pedro Lobito Avatar answered Oct 21 '22 08:10

Pedro Lobito


You can use the class android.os.Build to get most of the device information.

For example:

String myDeviceModel = android.os.Build.MODEL;
like image 36
MByD Avatar answered Oct 21 '22 10:10

MByD