We used the hidden WifiManager API to turn on the Wi-Fi modem and create an access point. Now the problem with API 26 on Android is that the tag has @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED)been added to the function setWifiApEnabled, and now that invocation returns false and the following log is printed:
W / WifiManager: PACKAGE_NAME tried to call setWifiApEnabled enabled = true
Reading the new documentation, she says that the function is deprecated and will be removed in the upcoming version and should be used instead ConnectivityManager#startTetheringif the caller has the correct permission, but this approach has the same problem as the TETHER_PRIVILEGED permissions. Another option presented in the documentation is to use LocalOnlyHotspot, but this is not suitable for the project, since the created access point does not have an Internet connection.
I also tested the function startSoftApfrom a hidden API, but did not have successful results, because the following exception was thrown:
WifiService: neither user 10164 nor the current process has android.permission.NETWORK_STACK
Is there any workaround for activating a Wi-Fi hotspot for the new APIs? I was also looking for alternatives to a Wi-Fi modem, but the only viable alternative seems to be Bluetooth binding, bypassing only 3G speed. Wifi Aware and Wifi P2P were also considered, but they have an Internet connection problem that is not shared between devices.
Any suggestions on how to approach this?
source
share