B4A Library Simple WIFI library

HotShoe

Well-Known Member
Licensed User
A new class MLscan has been added to scan for wireless AP's.

--- Jem
 

Peter Simpson

Expert
Licensed User
Hello,
Erm erm erm, thank you @HotShoe , I wasn't expecting you to do it today. And wow it's really really really fast. It's faster than other solutions on the forum and less cluttered too. It works absolutely perfect :)

Keep up the good work, cheers :cool:

Go and poor yourself one of these, you deserve it...
pint-lager-extra_786145f.jpg

10k image file.
 
Last edited:

netchicken

Active Member
Licensed User
This is a great little application @HotShoe . I was wondering if we could access the signal strength of a wifi point. That way I could pass it to google maps and get a wifi range :) or even pass it to a needle that starts to point to where the wireless router is after you get some points to triangulate :)
 

HotShoe

Well-Known Member
Licensed User
I don't think that will be too much of a problem. It'll be later in the week before I can get back to this though. I am snowed under with work for now.

--- Jem
 

HotShoe

Well-Known Member
Licensed User
Version 1.06 added to first post.

--- Jem
 

incendio

Well-Known Member
Licensed User
Though I am not using this lib right now, but thanks a lot for this useful utility.
 

HotShoe

Well-Known Member
Licensed User
Thanks, I'll change that.

--- Jem
 

HotShoe

Well-Known Member
Licensed User
Thank you sir.
 

Harris

Expert
Licensed User
Excellent lib!!

Just one thing I have noticed. getSSID will throw a null pointer exception if called when not connected to AP. All others return empty string (IP, MAC).

This will come in handy to determine signal strength before I start down and up loading data (which may get cut off due to wander too far from the AP).

Thanks so much.

B4X:
Sub wifi1_Tick

    wifilbl.Text = "WIFI = "&wifi.IsWifiConnected
    iplbl.Text  = "My IP = "&wifi.getIPAddress
    If wifi.IsWifiConnected = True Then  ' would often report true and throw exception
      If wifi.getWifiStrength > 50 Then  ' added to prevent exception from above
          inetlbl.Text = "Internet = "&wifi.isOnline&"  SSID: "&wifi.getSSID
      End If
    Else
      inetlbl.Text = "Internet = "&wifi.isOnline&"  SSID: none"
    End If
    maclbl.Text  = "MAC address = "&wifi.getMACAddress
    dblbl.Text    = wifi.getWifiSignal  & " DB"
    levellbl.Text = wifi.getWifiStrength & "%"
   

End Sub
 
Last edited:

HotShoe

Well-Known Member
Licensed User
Harris,

Sorry about that I completely missed it. try version 1.07 in the first post.

I have also made a couiple changes to the wifitest project included in the zip file.

--- Jem
 

Harris

Expert
Licensed User
Harris,

Sorry about that I completely missed it. try version 1.07 in the first post.

I have also made a couiple changes to the wifitest project included in the zip file.

--- Jem
Will do and thanks again!

I may have missed this somewhere, but how do you determine Internet (isOnline), ping a site or does:
  • android.permission.ACCESS_NETWORK_STATE handle this call
 

HotShoe

Well-Known Member
Licensed User
Actually, the state manager will lie to you about the connection status sometimes, so I am using the connectivity manager to see if there is a remote IP address and received packets.

--- Jem
 

Harris

Expert
Licensed User
Ok, I see.

We had this issue elsewhere. Not an easy one to solve.
We were attempting to ping a url and if we got a response - then we had network.

I don't envy your attempts to resolve.

Thanks for the 1.07

Cheers
 
Top