This should be possible using WifiManager
's setWifiApEnabled()
method.
However, this method is only available up to Android SDK 27. It is marked as a SystemAPI and requires android.Manifest.permission.TETHER_PRIVILEGED
.
It is therefore strongly unrecommended to implement this functionality for the reason that Google doesn't provide any official API call for enabling the mobile hotspot.
You can read more about this topic here:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.