public class

DeviceInfo

extends Object
java.lang.Object
   ↳ com.neomades.util.DeviceInfo

Class Overview

Used for Runtime conditioning. Different than TargetInfo. TargetInfo will condition the presence of a part of code, but DeviceInfo will condition the execution of code (code will be present whatever the binary).

To use this class, the PHONE_STATE permission must be declared in the URS file.

Summary

Constants
int ANDROID_10_0 Android Q (10.0)
int ANDROID_11_0 Android 11.0
int ANDROID_2_2 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_2_3 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_2_3_3 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_3_0 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_3_1 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_3_2 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_4_0 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_4_1 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_4_2 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_4_3 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_4_4 Android KitKat (4.4.X)
int ANDROID_5_0 Android Lollipop (5.0)
int ANDROID_5_1 Android Lollipop MR1 (5.1)
int ANDROID_6_0 Android M (6.0)
int ANDROID_7_0 Android N (7.0)
int ANDROID_7_1 Android N MR1 (7.1, 7.1.1)
int ANDROID_8_0 Android O (8.0)
int ANDROID_8_1 Android O MR1 (8.1)
int ANDROID_9_0 Android P (9.0)
int ANDROID_API_LEVEL_10 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_API_LEVEL_11 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_API_LEVEL_12 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_API_LEVEL_13 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_API_LEVEL_14 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_API_LEVEL_15 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_API_LEVEL_16 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_API_LEVEL_17 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_API_LEVEL_18 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_API_LEVEL_19 Android KitKat (4.4)
int ANDROID_API_LEVEL_21 Android Lollipop (5.0)
int ANDROID_API_LEVEL_22 Android Lollipop MR1 (5.1)
int ANDROID_API_LEVEL_23 Android M (6.0)
int ANDROID_API_LEVEL_24 Android N (7.0)
int ANDROID_API_LEVEL_25 Android N MR1 (7.1, 7.1.1)
int ANDROID_API_LEVEL_26 Android O (8.0)
int ANDROID_API_LEVEL_27 Android O MR1 (8.1)
int ANDROID_API_LEVEL_28 Android P (9.0)
int ANDROID_API_LEVEL_29 Android Q (10.0)
int ANDROID_API_LEVEL_30 Android 11.0
int ANDROID_API_LEVEL_8 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int ANDROID_API_LEVEL_9 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int IOS_10_0 iOS Version 10.0
int IOS_10_1 iOS Version 10.1
int IOS_10_2 iOS Version 10.2
int IOS_10_3 iOS Version 10.3
int IOS_11_0 iOS Version 11.0
int IOS_11_1 iOS Version 11.1
int IOS_11_2 iOS Version 11.2
int IOS_11_3 iOS Version 11.3
int IOS_11_4 iOS Version 11.4
int IOS_12_0 iOS Version 12.0
int IOS_12_1 iOS Version 12.1
int IOS_12_2 iOS Version 12.2
int IOS_12_3 iOS Version 12.3
int IOS_12_4 iOS Version 12.4
int IOS_13_0 iOS Version 13.0
int IOS_13_1 iOS Version 13.1
int IOS_13_2 iOS Version 13.2
int IOS_13_3 iOS Version 13.3
int IOS_13_4 iOS Version 13.4
int IOS_13_5 iOS Version 13.5
int IOS_13_6 iOS Version 13.6
int IOS_14_0 iOS Version 14.0
int IOS_14_1 iOS Version 14.1
int IOS_14_2 iOS Version 14.2
int IOS_14_3 iOS Version 14.3
int IOS_15_0 iOS Version 15.0
int IOS_16_0 iOS Version 16.0
int IOS_17_0 iOS Version 17.0
int IOS_18_0 iOS Version 18.0
int IOS_19_0 iOS Version 19.0
int IOS_20_0 iOS Version 20.0
int IOS_7_0 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int IOS_7_1 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int IOS_8_0 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int IOS_8_1 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int IOS_8_2 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int IOS_8_3 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int IOS_8_4 This constant is deprecated. Since NeoMAD 4.5. No replacement.
int IOS_9_0 iOS Version 9.0
int IOS_9_1 iOS Version 9.1
int IOS_9_2 iOS Version 9.2
int IOS_9_3 iOS Version 9.3
Public Methods
static String getBrand()
static String getDeviceName()
Returns the name identifying the device.
static String getIdentifier()
Returns the single identifier of the device.
static String getModel()
Returns the device model name.
static int getOSVersion()
static String getWifiIpAddress()
Returns the Wifi interface IP address.
static boolean isIPad()
Return true if the current running device is an iPAD
static boolean isIPhone()
Return true if the current running device is an iPhone
static boolean isIPhoneXFamilly()
Returns true if the current device is an "iPhone X" family device (iPhone X, iPhnoe 11, iPhone 12...).
static boolean isTablet()
Returns true if the current running device is a tablet.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int ANDROID_10_0

Android Q (10.0)

Constant Value: 29 (0x0000001d)

public static final int ANDROID_11_0

Android 11.0

Constant Value: 30 (0x0000001e)

public static final int ANDROID_2_2

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

/** Android Froyo (2.2.X)

Constant Value: 8 (0x00000008)

public static final int ANDROID_2_3

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Gingerbread (2.3.X)

Constant Value: 9 (0x00000009)

public static final int ANDROID_2_3_3

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Gingerbread MR01

Constant Value: 10 (0x0000000a)

public static final int ANDROID_3_0

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Honeycomb (3.0.X)

Constant Value: 11 (0x0000000b)

public static final int ANDROID_3_1

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Honeycomb MR01 (3.1.X)

Constant Value: 12 (0x0000000c)

public static final int ANDROID_3_2

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Honeycomb MR02 (3.2.X)

Constant Value: 13 (0x0000000d)

public static final int ANDROID_4_0

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Ice Cream Sandwich (4.0.X)

Constant Value: 14 (0x0000000e)

public static final int ANDROID_4_1

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Jelly Bean (4.1.X)

Constant Value: 16 (0x00000010)

public static final int ANDROID_4_2

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Jelly Bean MR1 (4.2.X)

Constant Value: 17 (0x00000011)

public static final int ANDROID_4_3

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Jelly Bean MR2 (4.3.X)

Constant Value: 18 (0x00000012)

public static final int ANDROID_4_4

Android KitKat (4.4.X)

Constant Value: 19 (0x00000013)

public static final int ANDROID_5_0

Android Lollipop (5.0)

Constant Value: 21 (0x00000015)

public static final int ANDROID_5_1

Android Lollipop MR1 (5.1)

Constant Value: 22 (0x00000016)

public static final int ANDROID_6_0

Android M (6.0)

Constant Value: 23 (0x00000017)

public static final int ANDROID_7_0

Android N (7.0)

Constant Value: 24 (0x00000018)

public static final int ANDROID_7_1

Android N MR1 (7.1, 7.1.1)

Constant Value: 25 (0x00000019)

public static final int ANDROID_8_0

Android O (8.0)

Constant Value: 26 (0x0000001a)

public static final int ANDROID_8_1

Android O MR1 (8.1)

Constant Value: 27 (0x0000001b)

public static final int ANDROID_9_0

Android P (9.0)

Constant Value: 28 (0x0000001c)

public static final int ANDROID_API_LEVEL_10

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Gingerbread MR01

Constant Value: 10 (0x0000000a)

public static final int ANDROID_API_LEVEL_11

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Honeycomb (3.0.X)

Constant Value: 11 (0x0000000b)

public static final int ANDROID_API_LEVEL_12

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Honeycomb MR01 (3.1.X)

Constant Value: 12 (0x0000000c)

public static final int ANDROID_API_LEVEL_13

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Honeycomb MR02 (3.2.X)

Constant Value: 13 (0x0000000d)

public static final int ANDROID_API_LEVEL_14

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Ice Cream Sandwich (4.0.X)

Constant Value: 14 (0x0000000e)

public static final int ANDROID_API_LEVEL_15

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Ice Cream Sandwich (4.0.3, 4.0.4)

Constant Value: 15 (0x0000000f)

public static final int ANDROID_API_LEVEL_16

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Jelly Bean (Android 4.1, 4.1.1)

Constant Value: 16 (0x00000010)

public static final int ANDROID_API_LEVEL_17

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Jelly Bean MR1 (4.2, 4.2.2)

Constant Value: 17 (0x00000011)

public static final int ANDROID_API_LEVEL_18

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Jelly Bean MR2 (4.3)

Constant Value: 18 (0x00000012)

public static final int ANDROID_API_LEVEL_19

Android KitKat (4.4)

Constant Value: 19 (0x00000013)

public static final int ANDROID_API_LEVEL_21

Android Lollipop (5.0)

Constant Value: 21 (0x00000015)

public static final int ANDROID_API_LEVEL_22

Android Lollipop MR1 (5.1)

Constant Value: 22 (0x00000016)

public static final int ANDROID_API_LEVEL_23

Android M (6.0)

Constant Value: 23 (0x00000017)

public static final int ANDROID_API_LEVEL_24

Android N (7.0)

Constant Value: 24 (0x00000018)

public static final int ANDROID_API_LEVEL_25

Android N MR1 (7.1, 7.1.1)

Constant Value: 25 (0x00000019)

public static final int ANDROID_API_LEVEL_26

Android O (8.0)

Constant Value: 26 (0x0000001a)

public static final int ANDROID_API_LEVEL_27

Android O MR1 (8.1)

Constant Value: 27 (0x0000001b)

public static final int ANDROID_API_LEVEL_28

Android P (9.0)

Constant Value: 28 (0x0000001c)

public static final int ANDROID_API_LEVEL_29

Android Q (10.0)

Constant Value: 29 (0x0000001d)

public static final int ANDROID_API_LEVEL_30

Android 11.0

Constant Value: 30 (0x0000001e)

public static final int ANDROID_API_LEVEL_8

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Froyo (2.2.X)

Constant Value: 8 (0x00000008)

public static final int ANDROID_API_LEVEL_9

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

Android Gingerbread (2.3.X)

Constant Value: 9 (0x00000009)

public static final int IOS_10_0

iOS Version 10.0

Constant Value: 100 (0x00000064)

public static final int IOS_10_1

iOS Version 10.1

Constant Value: 101 (0x00000065)

public static final int IOS_10_2

iOS Version 10.2

Constant Value: 102 (0x00000066)

public static final int IOS_10_3

iOS Version 10.3

Constant Value: 103 (0x00000067)

public static final int IOS_11_0

iOS Version 11.0

Constant Value: 110 (0x0000006e)

public static final int IOS_11_1

iOS Version 11.1

Constant Value: 111 (0x0000006f)

public static final int IOS_11_2

iOS Version 11.2

Constant Value: 112 (0x00000070)

public static final int IOS_11_3

iOS Version 11.3

Constant Value: 113 (0x00000071)

public static final int IOS_11_4

iOS Version 11.4

Constant Value: 114 (0x00000072)

public static final int IOS_12_0

iOS Version 12.0

Constant Value: 120 (0x00000078)

public static final int IOS_12_1

iOS Version 12.1

Constant Value: 121 (0x00000079)

public static final int IOS_12_2

iOS Version 12.2

Constant Value: 122 (0x0000007a)

public static final int IOS_12_3

iOS Version 12.3

Constant Value: 123 (0x0000007b)

public static final int IOS_12_4

iOS Version 12.4

Constant Value: 124 (0x0000007c)

public static final int IOS_13_0

iOS Version 13.0

Constant Value: 130 (0x00000082)

public static final int IOS_13_1

iOS Version 13.1

Constant Value: 131 (0x00000083)

public static final int IOS_13_2

iOS Version 13.2

Constant Value: 132 (0x00000084)

public static final int IOS_13_3

iOS Version 13.3

Constant Value: 133 (0x00000085)

public static final int IOS_13_4

iOS Version 13.4

Constant Value: 134 (0x00000086)

public static final int IOS_13_5

iOS Version 13.5

Constant Value: 135 (0x00000087)

public static final int IOS_13_6

iOS Version 13.6

Constant Value: 136 (0x00000088)

public static final int IOS_14_0

iOS Version 14.0

Constant Value: 140 (0x0000008c)

public static final int IOS_14_1

iOS Version 14.1

Constant Value: 141 (0x0000008d)

public static final int IOS_14_2

iOS Version 14.2

Constant Value: 142 (0x0000008e)

public static final int IOS_14_3

iOS Version 14.3

Constant Value: 143 (0x0000008f)

public static final int IOS_15_0

iOS Version 15.0

Constant Value: 150 (0x00000096)

public static final int IOS_16_0

iOS Version 16.0

Constant Value: 160 (0x000000a0)

public static final int IOS_17_0

iOS Version 17.0

Constant Value: 170 (0x000000aa)

public static final int IOS_18_0

iOS Version 18.0

Constant Value: 180 (0x000000b4)

public static final int IOS_19_0

iOS Version 19.0

Constant Value: 190 (0x000000be)

public static final int IOS_20_0

iOS Version 20.0

Constant Value: 200 (0x000000c8)

public static final int IOS_7_0

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

iOS Version 7.0

Constant Value: 70 (0x00000046)

public static final int IOS_7_1

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

iOS Version 7.1

Constant Value: 71 (0x00000047)

public static final int IOS_8_0

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

iOS Version 8.0

Constant Value: 80 (0x00000050)

public static final int IOS_8_1

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

iOS Version 8.1

Constant Value: 81 (0x00000051)

public static final int IOS_8_2

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

iOS Version 8.2

Constant Value: 82 (0x00000052)

public static final int IOS_8_3

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

iOS Version 8.3

Constant Value: 83 (0x00000053)

public static final int IOS_8_4

This constant is deprecated.
Since NeoMAD 4.5. No replacement.

iOS Version 8.4

Constant Value: 84 (0x00000054)

public static final int IOS_9_0

iOS Version 9.0

Constant Value: 90 (0x0000005a)

public static final int IOS_9_1

iOS Version 9.1

Constant Value: 91 (0x0000005b)

public static final int IOS_9_2

iOS Version 9.2

Constant Value: 92 (0x0000005c)

public static final int IOS_9_3

iOS Version 9.3

Constant Value: 93 (0x0000005d)

Public Methods

public static String getBrand ()

Returns
  • device brand

public static String getDeviceName ()

Returns the name identifying the device.

Cross platform considerations

  • In Android, this method returns "android-XXXXXXX" where XXXXXXX is the ADB identifier.
  • In iOS, this method returns the alphanumeric value set in the device settings: General > About settings

Returns
  • device name

public static String getIdentifier ()

Returns the single identifier of the device.

Cross Platform considerations

For iOS, it returns the 'identifier for vendor' (identifier for vendor: an alphanumeric string that uniquely identifies a device to the app's vendor). In both cases, the value changes when the user deletes all of that vendor's apps from the device and subsequently reinstalls one or more of them.(For more information, see Apple documentation)

Returns
  • the single identifier of the device (IMEI, UDID or PIN depending the platform)

public static String getModel ()

Returns the device model name.

Returns
  • device model name

public static int getOSVersion ()

Returns
  • OS version (see constants)

public static String getWifiIpAddress ()

Returns the Wifi interface IP address.

To use this method, the WIFI_STATE permission must be declared in the URS file.

Returns
  • the Wifi interface IP address
Throws
no Wifi interface was found
UnknownWifiAccessException

public static boolean isIPad ()

Return true if the current running device is an iPAD

Returns
  • true if it is an iPAD
See Also

public static boolean isIPhone ()

Return true if the current running device is an iPhone

Returns
  • true if it is an iPhone
See Also

public static boolean isIPhoneXFamilly ()

Returns true if the current device is an "iPhone X" family device (iPhone X, iPhnoe 11, iPhone 12...).

Returns
  • true if the current device is an "iPhone X" family device

public static boolean isTablet ()

Returns true if the current running device is a tablet.

Note: Some android tablets (old devices) are not considered as tablets.

Returns
  • true if it is a tablet