1

I've been working for a while on an application that enables and disables an Hotspot with specific SSID and Password in order to create a connection and trasfer data through FTP with the connection's client.

The client connects only to a specific SSID and Password, and that's why I've been trying to set things up in order to have it working, but since I've made a jump from pre-Android 8 to Android 10 I noticed that most methods and classes that used to manage these connections are either system-only or completely removed.

Does anyone know if there's a way to set a specific SSID and Password on WifiManager.LocalOnlyHotspot, or there's some other way to do that? My project basically depends on it and it'd be a shame if we had to change a lot of how interactions works because of these security changes.

Thanks for the help everyone!

Bonemannes
  • 11
  • 1
  • Sounds like you want something like this. https://developer.android.com/guide/topics/connectivity/localonlyhotspot EDIT: or maybe something like this. https://developer.android.com/training/connect-devices-wirelessly/wifi-direct – JonR85 Nov 17 '21 at 17:32
  • Yeah but the main problem about using these is that I need to specify a certain SSID and Password in order to let the Client connect, and I can't seem to find a method that allows me so in Android 10 – Bonemannes Nov 18 '21 at 09:25
  • https://developer.android.com/reference/android/net/wifi/WifiNetworkSpecifier.Builder#build() – JonR85 Nov 18 '21 at 14:53
  • As much as I've understood WifiNetworkSpecifier.Builder uses specific SSID/BSSID values to filter the connection where an app has interactions, so it's more of a filter for other connections and not to be used to create an Access Point with specific SSID/Pass and turn it on and off on demand through the app, am I correct? – Bonemannes Nov 18 '21 at 16:32

1 Answers1

0

I didn't find any universal answer on generic Android Devices, but since I'm using a Company Device I've found that they've implemented some inside libraries that allow these functions, and I've used the DevKit to make 'em.

So, the answer is you either ask the user to turn on the Wi-Fi or redirect them to an redirect page in case they don't have it enabled, or be lucky and have some kind of library that can allow you to do that implemented in your Android OS, if you're working from A8+

Bonemannes
  • 11
  • 1