I'm trying to connect to a WEP network using the latest Android Q Beta 4. The old style off communicating was quite straight forward. Using something like:
However in the Q release this has been deprecated. https://developer.android.com/refer...ddNetwork(android.net.wifi.WifiConfiguration)
I need to connect to a "WEP" network and I don’t see any option to set such configuration. The latest API im using is below.
Any help would be very much appreciated
Thanks in advance
Java:
WifiConfiguration connection = createApConfiguration(ssid, password, "WEP");
int res = wifiManager.addNetwork(connection);
However in the Q release this has been deprecated. https://developer.android.com/refer...ddNetwork(android.net.wifi.WifiConfiguration)
I need to connect to a "WEP" network and I don’t see any option to set such configuration. The latest API im using is below.
Java:
val specifier = WifiNetworkSpecifier.Builder()
.setSsid("NetworkID")
.setIsHiddenSsid(false)
.setIsEnhancedOpen(false)
.setBssidPattern(MacAddress.fromString("10:03:23:00:00:00"), MacAddress.fromString("ff:ff:ff:00:00:00"))
.build()
val request = NetworkRequest.Builder()
.addTransportType(NetworkCapabilities.TRANSPORT_WIFI)
.removeCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
.setNetworkSpecifier(specifier)
.build()
val connectivityManager = this.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
val networkCallback = object : ConnectivityManager.NetworkCallback() {
override fun onAvailable(network: Network?) {
Log.d("AVAILABLE", "onAvailable")
}
override fun onUnavailable() {
Log.d("UNAVAILABLE", "onUnavailable")
}}
connectivityManager.requestNetwork(request, networkCallback)
Any help would be very much appreciated
Thanks in advance