public class Network extends AccountManager
setNetwork which is used to connect to a user-defined network configuration getNetwork which returns the information about the current network the device is connected to, such as the network name, network type, IpAddress and MacAddress getWiFiMac which returns the WiFi Mac Address getEthernetMac which returns the Ethernet Mac Address installCertificate This method is used to send the EST Certificate configuration request.
It will generate EST user and ca_certificate.removeCertificate This method is used to send the EST Certificate configuration request.
It will remove EST user and ca_certificate.installLocalCertificate This method is used to install the local wifi certificates even when device is offline.setEthStategetDHCPServerHostNameinstallCertificate(Context, ESTConfig, Handler) API is used in your application unregisterCertificatesListenerreadSystemProperty
| Modifier and Type | Field and Description |
|---|---|
static int |
GET_ETH_MAC_ADDRESS_CODE
Response code which indicates that ethernet mac address is available.
|
static int |
GET_NETWORK_RESPONSE_CODE
Response code which indicates that info about current connected network is available.
|
static int |
GET_WIFI_MAC_ADDRESS_CODE
Response code which indicates that wifi mac address is available
|
static int |
INSTALL_CERTIFICATE_CODE
Response code of Certificate Installation process.
|
static int |
SET_EST_CERTIFICATE_CODE
Response code of ESTServer Certificate Install.
|
static int |
SET_NETWORK_RESPONSE_CODE
Response code which indicates whether network configuration was applied successfully or not
|
ACCESS_TOKEN_INVALID, ACCESS_TOKEN_VALID, API_ACCESS_TOKEN_INVALID, API_ACCESS_TOKEN_VALID, instance, IS_USER_LOGIN_OAUTH, isPolaris, OAUTH_TOKEN_INVALID, OAUTH_TOKEN_VALID, REQUEST_AUTH_LOGIN, REQUEST_AUTH_LOGOUT, SETUP_OAUTH_ERROR, SETUP_OAUTH_SUCCESS, TOKEN_VERIFY_FAIL, TOKEN_VERIFY_SUCCESSGENERIC_ERROR, OAUTH_PATH_TOKEN, OAUTH_PATH_VERIFY| Constructor and Description |
|---|
Network() |
| Modifier and Type | Method and Description |
|---|---|
void |
bindService(android.content.Context context,
ServiceConnectionCallback callback,
java.lang.String accessToken)
This method is used to bind the service to the application.
|
java.lang.String |
getDHCPServerHostName()
This method is used to obtain the DHCP server host name
|
java.lang.String |
getEthernetMac()
This method is used to obtain the getEthernetMac
|
boolean |
getEthState()
This method is used to get the on/off state of the Ethernet port
|
void |
getNetwork(android.content.Context context,
java.lang.String accessToken,
android.os.Handler handler)
This method is used to provide information about the network the device is currently connected to.
|
java.lang.String |
getWiFiMac()
This method is used to obtain the getWiFiMac
|
void |
installCertificate(android.content.Context context,
ESTConfig estConfig,
android.os.Handler handler)
This method is used to send the EST Certificate configuration request.
|
boolean |
installLocalCertificate(android.content.Context context,
CertificateConfig certificateConfig)
This method is used to install the local wifi certificates even when device is offline.
|
java.lang.String |
readSystemProperty(java.lang.String key)
Read system property
|
boolean |
removeCertificate(java.lang.String alias)
This method is used to send the EST Certificate configuration request.
|
void |
setEthState(boolean state)
This method is used to power on/off the ethernet port.
|
java.lang.String |
setNetmask(NetworkConfig networkConfig,
java.lang.String netmask) |
void |
setNetwork(android.content.Context context,
java.lang.String accessToken,
NetworkConfig networkConfig,
android.os.Handler handler)
This method is used to set a network configuration using the parameters described in NetworkConfig class and
connect to the network with the given configuration.
|
void |
setNetwork(android.content.Context context,
java.lang.String accessToken,
NetworkConfig networkConfig,
android.os.Handler handler,
java.lang.Boolean disableEthernet)
This method is used to set a network configuration using the parameters described in NetworkConfig class and
connect to the network with the given configuration.
|
void |
unbindService(android.content.Context context)
This method is used to unbind the service from the application.
|
void |
unregisterCertificatesListener(android.content.Context context)
This method is used to unregister the broadcast receiver registered when the
installCertificate(Context, ESTConfig, Handler) API.is used in your application. |
configureOAuthHostedUI, destroyOAuth, getBaseUri, getClientId, getEloAccessToken, getEloOAuthToken, getEnvironment, getProperty, isPolaris, isPolarisLocked, logoutOAuth, onOAuthActivityResult, selectEnvironment, setDefaultEnvironment, setProperty, stopOAuth, unregisterAccountManagerListener, verifyEloTokenclone, getEloIntentWithFlag, getMigrate, isDevice7Inch, isDeviceM100public static final int SET_NETWORK_RESPONSE_CODE
public static final int GET_NETWORK_RESPONSE_CODE
public static final int GET_WIFI_MAC_ADDRESS_CODE
public static final int GET_ETH_MAC_ADDRESS_CODE
public static final int SET_EST_CERTIFICATE_CODE
public static final int INSTALL_CERTIFICATE_CODE
public java.lang.String readSystemProperty(java.lang.String key)
key - system property keypublic void setNetwork(android.content.Context context,
java.lang.String accessToken,
NetworkConfig networkConfig,
android.os.Handler handler)
context - ContextaccessToken - An authentication token received from the Elo servers.networkConfig - NetworkConfig to set up the user datahandler - A handler to receive one or more of the following callback messages:
AccountManager.TOKEN_VERIFY_FAIL
Consts.GENERIC_ERROR
SET_NETWORK_RESPONSE_CODE
public void setNetwork(android.content.Context context,
java.lang.String accessToken,
NetworkConfig networkConfig,
android.os.Handler handler,
java.lang.Boolean disableEthernet)
context - ContextaccessToken - An authentication token received from the Elo servers.networkConfig - NetworkConfig to set up the user datahandler - A handler to receive one or more of the following callback messages:
AccountManager.TOKEN_VERIFY_FAIL
Consts.GENERIC_ERROR
SET_NETWORK_RESPONSE_CODE
disableEthernet - Boolean : to decide if we want to disable ethernet or notpublic void getNetwork(android.content.Context context,
java.lang.String accessToken,
android.os.Handler handler)
context - ContextaccessToken - An authentication token received from the Elo servers.handler - A handler to receive one or more of the following callback messages:
AccountManager.TOKEN_VERIFY_FAIL
Consts.GENERIC_ERROR
GET_NETWORK_RESPONSE_CODE
If the device is connected to Ethernet: The following parameters will be returned:
"active", "networkType", "macAddress", "ipAddress", "networkPrefixLength", “interface”, “proxyPort”, “ipAssignmentState”,
"proxyHost", “gateway”, “networkPrefix”, “dnsServers”, “proxyExclusion”
If the device is connected to Wifi: The following parameters will be returned:
"active", "networkType", "ssid_name", "macAddress", "ipAddress", "networkPrefixLength", “interface”, “proxyPort”, “ipAssignmentState”,
"speed", "rssi", "proxyHost", “gateway”, “networkPrefix”, “dnsServers”, “proxyExclusion”
public boolean getEthState()
public void setEthState(boolean state)
state - ethernet power state (on/off)public void unregisterCertificatesListener(android.content.Context context)
installCertificate(Context, ESTConfig, Handler) API.installCertificate(Context, ESTConfig, Handler) API. This ensures the receiver is not leaked.context - Context in which the Network APIs were usedpublic java.lang.String getWiFiMac()
public java.lang.String getEthernetMac()
public java.lang.String getDHCPServerHostName()
public java.lang.String setNetmask(NetworkConfig networkConfig, java.lang.String netmask)
public void installCertificate(android.content.Context context,
ESTConfig estConfig,
android.os.Handler handler)
context - Context it must be Activity or Application contextestConfig - ESTConfig having certificate details.handler - A handler to receive one or more of the following callback messages:
AccountManager.TOKEN_VERIFY_FAIL
Consts.GENERIC_ERROR
SET_EST_CERTIFICATE_CODE
public boolean removeCertificate(java.lang.String alias)
alias - String having certificate alias details.public boolean installLocalCertificate(android.content.Context context,
CertificateConfig certificateConfig)
context - Context it must be Activity or Application contextcertificateConfig - CertificateConfig Configuration of the local certificate files having
local certificate file path, name, type.
user_certificate_password if CERTIFICATE_TYPE is USER_CERTIFICATE.public void bindService(android.content.Context context,
ServiceConnectionCallback callback,
java.lang.String accessToken)
context - Context in which the Network APIs were usedcallback - ServiceConnectionCallbackaccessToken - Stringpublic void unbindService(android.content.Context context)
context - Context in which the Network APIs were used