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.
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.
Android. To find your device's serial number in the software, go to Settings > System. Then jump into About Phone > Status.
Device Info is a simple and powerful Android application which gives you complete information about your Mobile device with advanced user interfaces.
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.
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
You can use the class android.os.Build to get most of the device information.
For example:
String myDeviceModel = android.os.Build.MODEL;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With