Sunday, September 17, 2017

Android developer device system information

Below are the code snippets with description to get Android sysgtem information from the device.

Device Information
Android Java code to get device information
Description
Example from device
Manufacturer
String manufacturer = Build.MANUFACTURER
A company which produce the mobile phone
Samsung
Brand
Build.BRAND
This is a name, that distinguishes one company product from others.
Samsung
Model
Build.MODEL
Distinct name of device.
S6
Board
Build.BOARD
Motherboard specifically refers to a PCB with expansion capability and as the name suggests, this board is often referred to as the mother of all components attached to it.

Hardware
Build.HARDWARE
Name of mobile system on chip manufacturer(SoC
Qcom
Serial No
Build.SERIAL
Hardware serial number
16239565652
Boot Loader
Build.BOOTLOADER
A system bootloader version number.

Screen Resolution
WindowManager windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
Display display = windowManager.getDefaultDisplay();
densityX = display.getWidth(); // default height width of screen
densityY = display.getHeight();
The number of horizontal and vertical pixels on a display screen.
1184*720 pixel
Android ID
Secure.getString(this.getContentResolver(),Secure.ANDROID_ID);
A 64bit number that is randomly generated on the device first boot and should remain constant for the lifetime of the device.
8fed34ffere4343fd
OS Details



Version
VERSION.SDK_INT = 26 Version is 6.0.1
Unique version number for Android OS
7.1.1
Version Name
VERSION.SDK_INT = 26 Version name is Mashmallow
Unique name of OS version
Nougat
API Level
VERSION.SDK_INT
API levels manage the app compatibility across different versions of android.
25
Build ID
Build.ID
Either a changelist number or a label like eg:M4-rc20
NMF26F
Build Time
Build.TIME
Time when System OS build.
Tue Nov 22 2016
Fingerprint
Build.FINGERPRINT;
A string that uniquely identifies this build.
Samsung/S6/S6:7.1.1/NMF26F:user/release-keys
CPU Details



CPU Model
Adb to the device and cat /proc/cpuinfo.
The first Processor field will have CPU model
Model name of CPU
AArch64 Processor rev 1 (aarch64)
Cores
Adb to the device and cat /proc/cpuinfo.
Number of Processor field will give count of Cores – Usually it will be from (0 – 5) for 6 cores or (0 – 3) for 4 cores
Number of available processor cores on device.
4
Actual RAM
Adb to the device and cat /proc/meminfo.
MemTotal field will give memory info in KB. Usually it will be 500MB or 1GB or more

The Amount of RAM company offers in Specifications(1GB = 1024MB)
4GB
Physical Available RAM
Adb to the device and enter free -m
Mem: field of total will give RAM available.
The Amount of RAM physically available in your device(1GB = 1024MB).
1871 MB
Hardware
Adb to the device and cat /proc/cpuinfo.
The Hardware field will have Hardware information
CPU Hardware model name(eg: MT6752 that is Mediatek MT6752)
Qualcomm Tech, Inc MSM8996pro
WIFI
getPackageManager().hasSystemFeature("android.hardware.wifi")
Wi-Fi or WiFi is a technology for wireless local area networking with devices based on the IEEE 802.11 standards.Wi-Fi compatible devices can connect to the Internet via a WLAN network and a wireless access point.
Available or Not Supported
WIFI Direct
getPackageManager().hasSystemFeature("android.hardware.wifi.direct")
Wi-Fi Direct, initially called Wi-Fi P2P, is a Wi-Fi standard enabling devices to easily connect with each other without requiring a wireless access point. Wi-Fi Direct allows two devices to establish a direct Wi-Fi connection without requiring a wireless router.
Available or Not Supported
Bluetooth
getPackageManager().hasSystemFeature("android.hardware.bluetooth")
Bluetooth is a wireless technology standard for exchanging data over short distances (using short-wavelength UHF radio waves in the ISM band from 2.4 to 2.485 GHz) from fixed and mobile devices, and building personal area networks (PANs).
Available or Not Supported
Bluetooth LE
getPackageManager().hasSystemFeature("android.hardware.bluetooth_le")
Bluetooth Low Energy (BLE) is designed to provide significantly lower power consumption. This allows Android apps to communicate with BLE devices that have stricter power requirements, such as proximity sensors, heart rate monitors, and fitness devices.
Available or Not Supported
GPS
getPackageManager().hasSystemFeature("android.hardware.location.gps")
The Global Positioning System (GPS) is a space-based radionavigation system. These technologies can enhance the usefulness of the GPS positioning information.
Available or Not Supported
Camera Flash
getPackageManager().hasSystemFeature("android.hardware.camera.flash")
Check whether the device contain a camera Flash.
Available or Not Supported
Camera Front
getPackageManager().hasSystemFeature("android.hardware.camera.front")
Check whether the device contain a Front camera.
Available or Not Supported
Microphone
getPackageManager().hasSystemFeature("android.hardware.microphone")
Checking the availability of Microphone
Available or Not Supported
NFC
getPackageManager().hasSystemFeature("android.hardware.nfc")
Near-field communication (NFC) is a set of communication protocols that enable two electronic devices, one of which is usually a portable device such as a smartphone, to establish communication by bringing them within 4 cm (1.6 in) of each other.NFC devices are used in contactless payment systems, similar to those used in credit cards and electronic ticket smartcards and allow mobile payment to replace/supplement these systems.
Available or Not Supported
USB Host
getPackageManager().hasSystemFeature("android.hardware.usb.host")
When your Android-powered device is in USB host mode, it acts as the USB host, powers the bus, and enumerates connected USB devices. USB host mode is supported in Android 3.1 and higher.
Available or Not Supported
USB Accessory
getPackageManager().hasSystemFeature("android.hardware.usb.accessory")
USB accessory mode allows users to connect USB host hardware specifically designed for Android-powered devices.This allows Android-powered devices that cannot act as a USB host to still interact with USB hardware. When an Android-powered device is in USB accessory mode, the attached Android USB accessory acts as the host, provides power to the USB bus, and enumerates connected devices.
Available or Not Supported
Multitouch
getPackageManager().hasSystemFeature("android.hardware.touchscreen.multitouch")
A multi-touch is when multiple pointers (fingers) touch the screen at the same time.
Available or Not Supported
Audio low-latency
getPackageManager().hasSystemFeature("android.hardware.audio.low_latency")
Check whether the device support Audio low-latency. Latency is the time it takes for a signal to travel through a system.
Available or Not Supported
Audio Output
getPackageManager().hasSystemFeature("android.hardware.audio.output")
Check whether the device support Audio Output.
Available or Not Supported
Professional Audio

Professional audio, occasionally abbreviated as pro audio, refers to both an activity and a type of high quality audio equipment.
Available or Not Supported
Consumer IR
getPackageManager().hasSystemFeature("android.hardware.consumerir")
Consumer IR, consumer infrared, or CIR, refers to a wide variety of devices employing the infrared electromagnetic spectrum for wireless communications.he type, speed, bandwidth, and power of the transmitted information depends on the particular CIR protocol employed.
Available or Not Supported
Gamepad Support
getPackageManager().hasSystemFeature("android.hardware.gamepad")
Whether the Gamepad support available or not.
Available or Not Supported
HIFI Sensors
getPackageManager().hasSystemFeature("android.hardware.sensor.hifi_sensors")
High fidelity sensor processing capabilities.
Available or Not Supported
Printing
getPackageManager().hasSystemFeature("android.software.print")
Printing support for device.
Available or Not Supported
CDMA
getPackageManager().hasSystemFeature("android.hardware.telephony.cdma")
Code-division multiple access (CDMA) is a channel access method used by various radio communication technologies.CDMA is used as the access method in many mobile phone standards.
Available or Not Supported
GSM
getPackageManager().hasSystemFeature("android.hardware.telephony.gsm")
GSM (Global System for Mobile Communications is a standard developed by the European Telecommunications Standards Institute (ETSI) to describe the protocols for second-generation (2G) digital cellular networks used by mobile phones.
Available or Not Supported
Fingerprint
getPackageManager()..hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)
Biometric hardware to detect a fingerprint.
Available or Not Supported
App Widgets
getPackageManager().hasSystemFeature("android.software.app_widgets")
App Widgets are miniature application views that can be embedded in other applications (such as the Home screen) and receive periodic updates.
Available or Not Supported
SIP
getPackageManager().hasSystemFeature("android.software.sip")
Android provides an API that supports the Session Initiation Protocol (SIP). This lets you add SIP-based internet telephony features to your applications. Android includes a full SIP protocol stack and integrated call management services that let applications easily set up outgoing and incoming voice calls, without having to manage sessions, transport-level communication, or audio record or playback directly.
Available or Not Supported
SIP-based VOIP
getPackageManager().hasSystemFeature("android.software.sip.voip")
A SIP connection is a marketing term for voice over Internet Protocol (VoIP) services offered by many Internet telephony service providers (ITSPs).
Available or Not Supported
Battery Information



Battery level
To get battery level register for a sticky intent
IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
Intent batteryStatus = registerReceiver(null, ifilter);

intent.getIntExtra("level", -1);
Percentage of battery charge
50%
Type
To get battery Type register for a sticky intent
IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
Intent batteryStatus = registerReceiver(null, ifilter);

intent.getStringExtra("technology");
Power Source
Li-ion Battery
Temperature
To get battery temperature register for a sticky intent
IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
Intent batteryStatus = registerReceiver(null, ifilter);

intent.getIntExtra("temperature", 0);
Battery Temperature
25.0 C
Voltage
To get battery voltage register for a sticky intent
IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
Intent batteryStatus = registerReceiver(null, ifilter);

intent.getIntExtra("voltage", 0);
Battery Voltage
3.194 V
Status
To get battery status register for a sticky intent
IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
Intent batteryStatus = registerReceiver(null, ifilter);

intent.getIntExtra("status", 0);
Battery Status
Charging
Network



WiFi
NetworkInfo activeNetworkInfo = ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo();

activeNetworkInfo.getType() == 1
Show if wifi is connected or not
Connected
3G/4G
NetworkInfo activeNetworkInfo = ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo();

activeNetworkInfo.getSubtype() == 15
Shows if cellular network is present or not
3G
WiFi IP Details
WifiInfo connectionInfo = ((WifiManager) m797h().getSystemService("wifi")).getConnectionInfo();

connectionInfo.getIpAddress(); // IP Address
connectionInfo.getSSID() // Wifi AP name
connectionInfo.getBSSID() // MAC Address
connectionInfo.getLinkSpeed() // Link speed
WiFi IP address
10.24.25.2
Sensors
SensorManager sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
List<Sensor> sensors sensors = sensorManager.getSensorList(Sensor.TYPE_ALL);

Lists all the sensors supported
Accelometer
Step Sensor
Gyroscope
Camera Informatio
Camera.getCameraInfo(i, new CameraInfo());
        Camera open = Camera.open(i);
        Parameters parameters = open.getParameters();
Camera Information

System  apps
List<PackageInfo> apps = getPackageManager().getInstalledPackages(0);

for (ApplicationInfo aInfo : apps) {

if ((aInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0)
//System apps
}
List all system apps

User apps
List<PackageInfo> apps = getPackageManager().getInstalledPackages(0);

for (ApplicationInfo aInfo : apps) {

if (!(aInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0)
//System apps
}
List all User apps

Share:

0 comments:

Post a Comment

Popular Posts

Contact Form

Name

Email *

Message *