I'm trying to create a WiFi hotspot on the newer versions of Android
, the hotspot does not need internet access, just a local network. I want to be able to set the SSID and passphrase of the hotspot manually but cannot find a way to do this from an android app. (The idea is to have a Raspberry Pi device listening for the hotspot, to connect and send 'data' once it is in range - for this to happen the SSID and passphrase need to be known/configured beforehand.)
I've tried using WifiManager
's method startLocalOnlyHotspot()
; however, this method generates a random SSID and passphrase, which won't help me.
I did manage to find some functions that would be very helpful in generating a hotspot here. The WifiManager.java class has the setSoftApConfiguration()
method and also has the startTetheredHotspot()
; however, they don't seem to be available for use in Android Studio. Is there a reason these methods don't work?
I also came across the same functions that don't work here.
My question is, can I configure a hotspot and set its SSID and passphrase manually on the newer versions of android? (Preferable without needing to insert a SIM card as well, but that is another issue)