| java.lang.Object | |
| ↳ | com.neomades.io.Network |
Class utility that describes the status of network.
To use this class, the NETWORK_STATE permission must be declared in the URS file.
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int | TYPE_ETHERNET | Ethernet | |||||||||
| int | TYPE_MOBILE | Cellular, GPRS, 3G, Roaming | |||||||||
| int | TYPE_NONE | No network | |||||||||
| int | TYPE_WIFI | WIFI | |||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| static int |
getActiveType()
Returns the active network type.
| ||||||||||
| static boolean |
isConnected(int type)
Checks whether the network connectivity exists and could establish
connections and pass data.
| ||||||||||
| static boolean |
isConnected()
Checks whether the network connectivity exists and could establish
connections and pass data.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Ethernet
Cellular, GPRS, 3G, Roaming
No network
WIFI
Returns the active network type.
| SecurityException | if the type could be known for permissions reasons |
|---|
Checks whether the network connectivity exists and could establish
connections and pass data. The network type is given by
parameter.
| type | the type of network (WIFI, MOBILE, ETHERNET) |
|---|
| SecurityException | if the state could be known for permissions reasons |
|---|---|
| RuntimeException | The platform does not support this function. |
Checks whether the network connectivity exists and could establish connections and pass data. (through the active network type).
| SecurityException | if the state could be known for permissions reasons |
|---|