android.device
Class DeviceManager

java.lang.Object
  extended by android.device.DeviceManager

public class DeviceManager
extends java.lang.Object

The DeviceManager class provides support to get and set the device configurations.


Constructor Summary
DeviceManager()
           
 
Method Summary
 void enableHomeKey(boolean enable)
          Enable/Disable device HOME KEY
 void enableStatusBar(boolean enable)
          Enable/Disable the device status bar
 java.lang.String getDeviceId()
          Get the device product serial number
 boolean getDockerState()
          Support i9000S(Android 4.3) only.Return the currently active docking station connected state .
 java.lang.String getTIDSN()
           
 boolean setAPN(java.lang.String name, java.lang.String apn, java.lang.String proxy, int port, java.lang.String user, java.lang.String server, java.lang.String password, java.lang.String mmsc, java.lang.String mcc, java.lang.String mnc, java.lang.String mmsproxy, int mmsport, int authtype, java.lang.String type, java.lang.String protocol, int bearer, java.lang.String roamingprotocol, boolean current)
          Sets the APN (access point name) configurations for mobile data network
 boolean setCurrentTime(long when)
          Sets the current wall time, in milliseconds.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceManager

public DeviceManager()
Method Detail

getDeviceId

public java.lang.String getDeviceId()
Get the device product serial number

Returns:
in the form of 14 alphanumeric characters.

getTIDSN

public java.lang.String getTIDSN()

setCurrentTime

public boolean setCurrentTime(long when)
Sets the current wall time, in milliseconds.

Parameters:
when - in milliseconds

enableHomeKey

public void enableHomeKey(boolean enable)
Enable/Disable device HOME KEY

Parameters:
enable - value: false disable the Home KEY function. device reboot the state miss.
Example in your project Activity:
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  new DeviceManager().enableHomeKey(false);
}
You can revert the home key when exit your application . protected void onDestroy() {
  new DeviceManager().enableHomeKey(true);
}

enableStatusBar

public void enableStatusBar(boolean enable)
Enable/Disable the device status bar

Parameters:
enable - Set to true to enable the status bar. Set to false to disable the status bar expand. Note This status is not persistent. It will revert to the default condition (which is the enabled state) at th next reboot

setAPN

public boolean setAPN(java.lang.String name,
                      java.lang.String apn,
                      java.lang.String proxy,
                      int port,
                      java.lang.String user,
                      java.lang.String server,
                      java.lang.String password,
                      java.lang.String mmsc,
                      java.lang.String mcc,
                      java.lang.String mnc,
                      java.lang.String mmsproxy,
                      int mmsport,
                      int authtype,
                      java.lang.String type,
                      java.lang.String protocol,
                      int bearer,
                      java.lang.String roamingprotocol,
                      boolean current)
Sets the APN (access point name) configurations for mobile data network

Parameters:
apn - APN name. Cannot be null.
authtype - Authentication type. Value:0(none) 1(PAP) 2(CHAP) 3(PAP or CHAP)
bearer - BEARER Radio Access Technology info.value: 0(none) 13(eHRPD) 14(LTE)
mcc - Mobile Country Code (MCC).
mmsc - MMSC URL.
mmsproxy - MMS proxy address.
mmsport - MMS proxy port.
mnc - MNC Mobile Network Code (MNC). Cannot be null
name - Entry name. Cannot be null
password - APN password.
port - Proxy port.
protocol - The protocol to use to connect to this APN. value: IP IPv6 or IPv4v6
proxy - Proxy address.
roamingprotocol - The protocol to use to connect to this APN when roaming.
server - Server address.
type - Comma-delimited list of APN types.
user - APN username.
current - enable current set this APN
Returns:
Returns true if successful. Returns false if failed.

getDockerState

public boolean getDockerState()
Support i9000S(Android 4.3) only.Return the currently active docking station connected state . Default return false when runing on other devices.

Returns:
true The device is in Ethernet mode or USB Host mode