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.setEthStategetDHCPServerHostNameunregisterNetworkAPIListenerremoveCertificate API is used in your App unregisterRemoveCertificateAPIListenergetDHCPServerHostName(Context, String, Handler) is used in your application unregisterDHCPRecordsAPIListenerinstallCertificate(Context, String, ESTConfig, Handler) API is used in your application unregisterCertificatesListener
| Modifier and Type | Field and Description |
|---|---|
static int |
DHCP_SERVER_NAME
Response code for DHCP 230 Records
|
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 Network |
instance |
static int |
REMOVE_EST_CERTIFICATE_CODE
Response code of ESTServer Certificate Remove.
|
static int |
SET_EST_CERTIFICATE_CODE
Response code of ESTServer Certificate Install.
|
static int |
SET_ETH_STATE_RESULT_CODE
Response code for ethernet configuration
|
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, IS_USER_LOGIN_OAUTH, isPolaris, KEY_SERVER_ELO_POLARIS_DEV, KEY_SERVER_PRODUCTION_POLARIS, KEY_SERVER_QA_POLARIS, KEY_SERVER_STAGING_POLARIS, OAUTH_TOKEN_INVALID, OAUTH_TOKEN_VALID, REQUEST_AUTH_LOGIN, REQUEST_AUTH_LOGOUT, SETUP_OAUTH_ERROR, SETUP_OAUTH_SUCCESS, TOKEN_VERIFY_FAIL, TOKEN_VERIFY_SUCCESSELO_FOLDER, ELO_NETWORK_CONF_CSV_FILE, GENERIC_ERROR, isFROM, OAUTH_PATH_TOKEN, OAUTH_PATH_VERIFY, REQUEST_TOKEN, STR_CUSTOM_ANIM_IMAGE_FILE, STR_CUSTOM_ANIM_VIDEO_FILE, STR_CUSTOM_BRAND_LOGO_FILE, STR_CUSTOM_BRAND_NAME_FILE, STR_CUSTOM_BRAND_POWERED_BY_LOGO_FILE, STR_CUSTOM_LOCALE_NAME_FILE, STR_CUSTOM_WALLPAPER, STR_ELO_PATH_FOR_CUSTOM_ANIMATION, STR_SDCARD_ELO_DIR_PATH, VERIFY_TOKEN| Constructor and Description |
|---|
Network() |
| Modifier and Type | Method and Description |
|---|---|
void |
getDHCPServerHostName(android.content.Context context,
java.lang.String accessToken,
android.os.Handler handler)
This method is used to obtain the DHCP server host name
|
void |
getEthernetMac(android.content.Context context,
java.lang.String accessToken,
android.os.Handler handler)
This method is used to obtain Ethernet MacAddress
|
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.
|
void |
getWiFiMac(android.content.Context context,
java.lang.String accessToken,
android.os.Handler handler)
/**
This method is used to obtain Wifi MacAddress
|
void |
installCertificate(android.content.Context context,
java.lang.String accessToken,
ESTConfig estConfig,
android.os.Handler handler)
This method is used to send the EST Certificate configuration request.
|
void |
installLocalCertificate(android.content.Context context,
java.lang.String accessToken,
CertificateConfig certificateConfig,
android.os.Handler handler)
This method is used to install the local wifi certificates even when device is offline.
|
void |
removeCertificate(android.content.Context context,
java.lang.String accessToken,
java.lang.String alias,
android.os.Handler handler)
This method is used to send the EST Certificate configuration request.
|
void |
setEthState(android.content.Context context,
java.lang.String accessToken,
boolean state,
android.os.Handler handler)
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 |
unregisterCertificatesListener(android.content.Context context)
This method is used to unregister the broadcast receiver registered when the
installCertificate(Context, String, ESTConfig, Handler) API.is used in your application. |
void |
unregisterDHCPRecordsAPIListener(android.content.Context context)
This method is used to unregister the broadcast receiver registered when the
getDHCPServerHostName(Context, String, Handler) API.is used in your application. |
void |
unregisterNetworkAPIListener(android.content.Context context)
This method is used to unregister the broadcast receiver registered while using any of the Network APIs.
Please make sure to call this in the "onPause" and "onDestroy" methods in your activity Lifecycle if you made use of any of the Network APIs. |
void |
unregisterRemoveCertificateAPIListener(android.content.Context context)
This method is used to unregister the broadcast receiver registered when the
removeCertificate(Context, String, String, Handler) API is used in your App Please make sure to call this in the "onPause" and "onDestroy" methods in your activity Lifecycle if you made use of removeCertificate(Context, String, String, Handler) API. |
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 REMOVE_EST_CERTIFICATE_CODE
public static final int INSTALL_CERTIFICATE_CODE
public static final int DHCP_SERVER_NAME
public static final int SET_ETH_STATE_RESULT_CODE
public static Network instance
public 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 void setEthState(android.content.Context context,
java.lang.String accessToken,
boolean state,
android.os.Handler handler)
context - ContextaccessToken - An authentication token received from the Elo servers.state - ethernet power state (on/off)handler - 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 unregisterNetworkAPIListener(android.content.Context context)
context - Context in which the Network APIs were usedpublic void unregisterRemoveCertificateAPIListener(android.content.Context context)
removeCertificate(Context, String, String, Handler) API removeCertificate(Context, String, String, Handler) API. This ensures the receiver is not leaked.context - Context in which the Network APIs were usedpublic void unregisterDHCPRecordsAPIListener(android.content.Context context)
getDHCPServerHostName(Context, String, Handler) API.getDHCPServerHostName(Context, String, Handler) API. This ensures the receiver is not leaked.context - Context in which the Network APIs were usedpublic void unregisterCertificatesListener(android.content.Context context)
installCertificate(Context, String, ESTConfig, Handler) API.installCertificate(Context, String, ESTConfig, Handler) API. This ensures the receiver is not leaked.context - Context in which the Network APIs were usedpublic void getWiFiMac(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_WIFI_MAC_ADDRESS_CODE
public void getEthernetMac(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_ETH_MAC_ADDRESS_CODE
public void getDHCPServerHostName(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
public java.lang.String setNetmask(NetworkConfig networkConfig, java.lang.String netmask)
public void installCertificate(android.content.Context context,
java.lang.String accessToken,
ESTConfig estConfig,
android.os.Handler handler)
context - Context it must be Activity or Application contextaccessToken - An Offline authentication token.estConfig - 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 void removeCertificate(android.content.Context context,
java.lang.String accessToken,
java.lang.String alias,
android.os.Handler handler)
context - Context it must be Activity or Application contextaccessToken - An Offline authentication token.alias - String having certificate alias details.handler - A handler to receive one or more of the following callback messages:
AccountManager.TOKEN_VERIFY_FAIL
Consts.GENERIC_ERROR
REMOVE_EST_CERTIFICATE_CODE
public void installLocalCertificate(android.content.Context context,
java.lang.String accessToken,
CertificateConfig certificateConfig,
android.os.Handler handler)
context - Context it must be Activity or Application contextaccessToken - An Offline authentication token.certificateConfig - CertificateConfig Configuration of the local certificate files having
local certificate file path, name, type.
user_certificate_password if CERTIFICATE_TYPE is USER_CERTIFICATE.handler - A handler to receive one or more of the following callback messages:
AccountManager.TOKEN_VERIFY_FAIL
Consts.GENERIC_ERROR
INSTALL_CERTIFICATE_CODE