Android Question Simple WIFI library V. 3.07

labcold

Member
Licensed User
I am using this very well but I have come across a problem. For a particular client they want to stop people adding wifi APs to their devices. What I want to do is to do a check on startup that there are only the 'acceptable' APs in the list.
Using the library MLWifi and MLScan I can list the saved AP's and disconnect them, but I cannot seem to delete them from the list.
I use the code below to test this out.
I get a list of all the saved APs but mls.removeWifiAP(nid) always returns False.
I am running Android 7.7.1 and have already got the permissions:
android.permission.ACCESS_COARSE_LOCATION
android.permission.ACCESS_FINE_LOCATION
android.permission.ACCESS_NETWORK_STATE
android.permission.ACCESS_WIFI_STATE
android.permission.CHANGE_WIFI_STATE
android.permission.INTERNET
I have tried the removeWifiAP on both MLwifi and MLscan and neither actually remove the stored APs.
Am I missing something or is it a device based issue?
Thanks
Harry

B4X:
Private mlw As MLwifi
Private mls As MLScan
.....       
Dim wl As List = mls.listSavedNetworks
For Each item As String In wl
      Log(item)
      Dim lb() As String = Regex.Split(",",item)
      If IsNumber(lb(2)) Then
              Dim nid As Int
              nid=lb(2)
              log(mls.removeWifiAP(nid))
      End If
Next
 

labcold

Member
Licensed User
Thank you for the quick reply :D
I will be running this as an owner app but as I am debugging at the moment I haven't set this up. I will try this and see if it works :)
 

labcold

Member
Licensed User
OK thank you both very much - setting the owner app did the trick and I can do all I need :D
 
Top