de.enough.polish.util
Class DeviceInfo

java.lang.Object
  extended by de.enough.polish.util.DeviceInfo

public class DeviceInfo
extends Object

Provides information about the current device

  History
   04/02/2010  - David Rubin Added support for RIM vendor results in vendor
 

Copyright Enough Software 2009

Author:
Robert Virkus, j2mepolish@enough.de

Field Summary
static int VENDOR_ACER
          The vendor of this device is Acer
static int VENDOR_ALCATEL
          The vendor of this device is Alcatel
static int VENDOR_BLACKBERRY
          The vendor of this device is BlackBerry
static int VENDOR_LG
          The vendor of this device is LG
static int VENDOR_MOTOROLA
          The vendor of this device is Motorola
static int VENDOR_NOKIA
          The vendor of this device is Nokia
static int VENDOR_SAGEM
          The vendor of this device is Sagem
static int VENDOR_SAMSUNG
          The vendor of this device is Samsung
static int VENDOR_SONY_ERICSSON
          The vendor of this device is Sony Ericsson
static int VENDOR_UNKNOWN
          The vendor of this device is not known
static int VENDOR_ZTE
          The vendor of this device is ZTE
 
Method Summary
static String getDeviceId()
          Retrieves a unique ID of this device.
static String getDeviceName()
          Tries to determine the name of this device model, e.g.
static int getKeyInputModeSwitch()
          Tries to guess the key for changing the input mode, e.g.
static int getKeySpace()
          Tries to guess the key for entering a space character.
static String getPlatformName()
           
static int getVendor()
          Tries to detect the vendor of this device.
static String getVendorName()
          Retrieves the name of the device's vendor or null when it cannot be detected.
static boolean hasPointerEvents()
          Tests if the current device has pointer events
static boolean requiresFullRgbArrayForDrawRgb()
          Checks if the device requires a full RGB array consisting of the width x height of the covered area
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VENDOR_UNKNOWN

public static final int VENDOR_UNKNOWN
The vendor of this device is not known

See Also:
Constant Field Values

VENDOR_NOKIA

public static final int VENDOR_NOKIA
The vendor of this device is Nokia

See Also:
Constant Field Values

VENDOR_SAMSUNG

public static final int VENDOR_SAMSUNG
The vendor of this device is Samsung

See Also:
Constant Field Values

VENDOR_LG

public static final int VENDOR_LG
The vendor of this device is LG

See Also:
Constant Field Values

VENDOR_SONY_ERICSSON

public static final int VENDOR_SONY_ERICSSON
The vendor of this device is Sony Ericsson

See Also:
Constant Field Values

VENDOR_MOTOROLA

public static final int VENDOR_MOTOROLA
The vendor of this device is Motorola

See Also:
Constant Field Values

VENDOR_ZTE

public static final int VENDOR_ZTE
The vendor of this device is ZTE

See Also:
Constant Field Values

VENDOR_ACER

public static final int VENDOR_ACER
The vendor of this device is Acer

See Also:
Constant Field Values

VENDOR_ALCATEL

public static final int VENDOR_ALCATEL
The vendor of this device is Alcatel

See Also:
Constant Field Values

VENDOR_BLACKBERRY

public static final int VENDOR_BLACKBERRY
The vendor of this device is BlackBerry

See Also:
Constant Field Values

VENDOR_SAGEM

public static final int VENDOR_SAGEM
The vendor of this device is Sagem

See Also:
Constant Field Values
Method Detail

getVendor

public static int getVendor()
Tries to detect the vendor of this device.

Returns:
the vendor, e.g. VENDOR_NOKIA or VENDOR_UNKNOWN

getVendorName

public static String getVendorName()
Retrieves the name of the device's vendor or null when it cannot be detected.

Returns:
the vendor name or null

getDeviceName

public static String getDeviceName()
Tries to determine the name of this device model, e.g. "N97" when having a Nokia/N97

Returns:
the name of this device model or null when it cannot be determined

getPlatformName

public static String getPlatformName()

getKeyInputModeSwitch

public static int getKeyInputModeSwitch()
Tries to guess the key for changing the input mode, e.g. from 123 to abc.

Returns:
the key, by default Canvas.KEY_POUND

getKeySpace

public static int getKeySpace()
Tries to guess the key for entering a space character.

Returns:
the key, by default Canvas.KEY_NUM0;

requiresFullRgbArrayForDrawRgb

public static boolean requiresFullRgbArrayForDrawRgb()
Checks if the device requires a full RGB array consisting of the width x height of the covered area

Returns:
true when a full RGB array is required, false when the width of the covered area is sufficient

hasPointerEvents

public static boolean hasPointerEvents()
Tests if the current device has pointer events

Returns:
true when this device has pointer events

getDeviceId

public static String getDeviceId()
Retrieves a unique ID of this device. This could be the IMEI or the local Bluetooth address of this device. Note that some phones allow to access the IMEI but only when the application has been signed.

Returns:
the device id