public class WiFiSocketFactory extends Object
| Constructor and Description |
|---|
WiFiSocketFactory() |
| Modifier and Type | Method and Description |
|---|---|
static Socket |
createSocket(Context context)
Try to create a TCP socket which is bound to Wi-Fi network (for Android 5+)
|
public static Socket createSocket(Context context)
On Android 5 and later, this method tries to create a Socket instance which is bound to a Wi-Fi network. If the phone is not connected to a Wi-Fi network, or the app lacks required permission (ACCESS_NETWORK_STATE), then this method simply creates a Socket instance with "new Socket();".