... | @@ -512,21 +512,28 @@ https://invent.kde.org/network/kdeconnect-android/-/blob/master/src/org/kde/kdec |
... | @@ -512,21 +512,28 @@ https://invent.kde.org/network/kdeconnect-android/-/blob/master/src/org/kde/kdec |
|
## Wi-Fi
|
|
## Wi-Fi
|
|
|
|
|
|
Wi-Fi is widely supported by smartphones and other mobile devices, and allows for easy interoperation between platforms.
|
|
Wi-Fi is widely supported by smartphones and other mobile devices, and allows for easy interoperation between platforms.
|
|
Wi-Fi access points are available worldwide and may be usable (without internet access) even during internet shutdowns.
|
|
Wi-Fi networks are available worldwide and may be usable (without internet access) even during internet shutdowns.
|
|
|
|
|
|
Some Android devices can also act as access points.
|
|
### Wi-Fi Access Point
|
|
|
|
|
|
|
|
Some Android devices can act as Wi-Fi access points.
|
|
The system UI allows the user to enable an access point and configure its network name and password.
|
|
The system UI allows the user to enable an access point and configure its network name and password.
|
|
Clients connected to the access point can access the internet via the device providing the access point.
|
|
Clients connected to the access point can access the internet via the device providing the access point.
|
|
Some devices require a SIM card to be inserted before this feature can be used.
|
|
Some devices require a SIM card to be inserted before this feature can be used.
|
|
|
|
|
|
On Android versions 5.1 and earlier (API level 22), applications can use reflection to access a hidden API for enabling an access point, including specifying the network name and password.
|
|
On Android versions 5.1 and earlier (API level 22), applications can use reflection to access a hidden API for enabling an access point, including specifying the network name and password.
|
|
|
|
|
|
Android versions 8 and later (API level 26) have an API for creating a "local-only hotspot", which is an access point that doesn't share the device's internet connection with connected clients, but allows them to communicate with each other and with the device providing the access point.
|
|
Android versions 8 and later (API level 26) have an API for creating a "local-only hotspot", which is an access point that doesn't share the device's internet connection with connected clients.
|
|
|
|
|
|
<https://developer.android.com/reference/android/net/wifi/WifiManager#startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback,%20android.os.Handler)>
|
|
<https://developer.android.com/reference/android/net/wifi/WifiManager#startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback,%20android.os.Handler)>
|
|
|
|
|
|
This is similar to a Wi-Fi Direct legacy mode access point, which is described in the Wi-Fi Direct section.
|
|
This is similar to a Wi-Fi Direct legacy mode access point, which is described in the Wi-Fi Direct section.
|
|
|
|
|
|
|
|
With all of these methods, clients connected to the access point can typically connect to each other, and to the device providing the access point, via TCP and UDP.
|
|
|
|
The device providing the access point may not be able to connect to clients, however, because Android treats the access point interface differently from other network interfaces.
|
|
|
|
|
|
|
|
We still need to test whether LAN multicast and the NSD API can be used (by clients and/or the device providing the access point) on networks where the access point is provided through each of these methods.
|
|
|
|
|
|
### Wi-Fi Client
|
|
### Wi-Fi Client
|
|
|
|
|
|
On Android, connections to Wi-Fi access points are managed through the `WifiManager` API.
|
|
On Android, connections to Wi-Fi access points are managed through the `WifiManager` API.
|
... | @@ -535,7 +542,7 @@ On Android, connections to Wi-Fi access points are managed through the `WifiMana |
... | @@ -535,7 +542,7 @@ On Android, connections to Wi-Fi access points are managed through the `WifiMana |
|
|
|
|
|
A device connected to an access point can use TCP and UDP to communicate with other clients on the same network, if the access point allows it.
|
|
A device connected to an access point can use TCP and UDP to communicate with other clients on the same network, if the access point allows it.
|
|
|
|
|
|
To use Wi-Fi when the device's screen is turned off, it can be helpful to hold a `WifiLock` with the lock mode `WIFI_MODE_FULL_HIGH_PERF` to keep the Wi-Fi radio awake:
|
|
To use Wi-Fi when the device's screen is turned off, it can be helpful to hold a `WifiLock` with lock mode `WIFI_MODE_FULL_HIGH_PERF` to keep the Wi-Fi radio awake:
|
|
|
|
|
|
* <https://developer.android.com/reference/android/net/wifi/WifiManager.WifiLock>
|
|
* <https://developer.android.com/reference/android/net/wifi/WifiManager.WifiLock>
|
|
* <https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_HIGH_PERF>
|
|
* <https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_HIGH_PERF>
|
... | | ... | |