public class NetworkManager
extends java.lang.Object
Constructor and Description |
---|
NetworkManager(Context context) |
Modifier and Type | Method and Description |
---|---|
int |
connectNetwork(NetworkAvailable net,
java.lang.String password)
Try connect to a network.
|
java.util.List<NetworkAvailable> |
getAllNetworksAvailable()
This method returns a list of all Networks available that was create
by another device running the same application.
|
NetworkState |
getNetworkState()
This method returns a wifi access point state.
|
boolean |
isConnect() |
boolean |
removeNetwork()
Remove network that was connect before
|
void |
searchNetworks() |
int |
startNetwork(NetworkConfiguration netConfig)
Try start a new Access Point.
|
int |
stopNetwork() |
public NetworkState getNetworkState()
NetworkState
public void searchNetworks()
public java.util.List<NetworkAvailable> getAllNetworksAvailable()
NetworkAvailable
. Return null if the wifi is disable.
If the return was empty is because no networks are available.public boolean isConnect()
public int connectNetwork(NetworkAvailable net, java.lang.String password)
net
- password
- public boolean removeNetwork()
public int startNetwork(NetworkConfiguration netConfig)
netConfig
- @see NetworkConfiguration
getNetworkState()
before calling this method.public int stopNetwork()