Class DeviceInfo



  • public class DeviceInfo
    extends java.lang.Object
    Wrapper for device information.

    One source of information is android.os.Build and android.os.Build.VERSION. We also include MemoryInformation

    • Constructor Summary

      Constructors 
      Constructor and Description
      DeviceInfo(Context context) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.util.Map<java.lang.String,java.lang.String> getDeviceInfoAsMap()
      Create a key value map of device information
      java.lang.String getModelDeviceName()
      Gets the device name.
      java.lang.String getModelManufacturer()
      Gets the manufacturer of the device like HTC, Samsung etc.
      java.lang.String getModelName()
      Gets the model name of the device.
      int getVersionCode()
      Gets the API level of the OS
      java.lang.String getVersionName()
      Gets the OS version name of the device.
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DeviceInfo

        public DeviceInfo(Context context)
    • Method Detail

      • getModelName

        public java.lang.String getModelName()
        Gets the model name of the device. This will be the model name that is most recognisable by users
        Returns:
        A descriptive name of the device like "HTC One"
      • getVersionName

        public java.lang.String getVersionName()
        Gets the OS version name of the device.
        Returns:
        the OS version of the device, like 4.4.2
      • getVersionCode

        public int getVersionCode()
        Gets the API level of the OS
        Returns:
        the api level of the OS
      • getModelManufacturer

        public java.lang.String getModelManufacturer()
        Gets the manufacturer of the device like HTC, Samsung etc.
        Returns:
        the manufacturer of the device.
      • getModelDeviceName

        public java.lang.String getModelDeviceName()
        Gets the device name. This is usually a code-name like m7 for the HTC One
        Returns:
        The device name
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getDeviceInfoAsMap

        public java.util.Map<java.lang.String,java.lang.String> getDeviceInfoAsMap()
        Create a key value map of device information
        Returns:
        The device info as a map