0

Is it possible to find SSID and password of wifi hotspot network defined in Settings -> Network -> Hotspot & Tethering or Settings -> Portable Hotspot (depending on a device) in android Oreo or above? I need system hotspot so LocalOnlyHotspot is not an option for me. I found the way to achieve this using reflection, but since version 8.0 it does not work. Also, here I found the way to turn on wifi hotspot programmatically How to turn on/off wifi hotspot programmatically in Android 8.0 (Oreo) (Vishal Sharma answer). But I could not find the way to find SSID and password using this method.

Jon Doe
  • 25
  • 9

1 Answers1

1

in Xamarin Android Inside the OnStarted method you can get the ssid and the password in this way:

you have to translate this c# code to java and it will work

public override void OnStarted(WifiManager.LocalOnlyHotspotReservation reservation)
    {
        base.OnStarted(reservation);
        Log.Debug("callBack", "Wifi Hotspot is on now");

        //here is your ssid
        var ssid = reservation.WifiConfiguration.Ssid;

        //here is your password
        var password= reservation.WifiConfiguration.PreSharedKey ;

        mainActivity.mReservation = reservation;
    } 
Raouf
  • 21
  • 1
  • 4