B4A Library Simple WIFI library

Discussion in 'Additional libraries, classes and official updates' started by HotShoe, Mar 8, 2014.

  1. Peter Simpson

    Peter Simpson Expert Licensed User

    Well I must admit it @HotShoe , it's a really fast library there's no doubting that. IMO listing other local available WiFi networks maybe as a string array or list, is the only thing that is missing from this library, then it would be perfect.

    Cheers :cool:
     
    Last edited: Mar 29, 2014
  2. HotShoe

    HotShoe Well-Known Member Licensed User

    A new class MLscan has been added to scan for wireless AP's.

    --- Jem
     
    Peter Simpson likes this.
  3. Peter Simpson

    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: Mar 30, 2014
  4. netchicken

    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 :)
     
  5. HotShoe

    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
     
  6. HotShoe

    HotShoe Well-Known Member Licensed User

    Version 1.06 added to first post.

    --- Jem
     
  7. incendio

    incendio Well-Known Member Licensed User

    Though I am not using this lib right now, but thanks a lot for this useful utility.
     
  8. ixdev

    ixdev Member Licensed User

    Thanks for this
     
  9. mr23

    mr23 Active Member Licensed User

    FYI the wifitext sample has "getWifiLinkSpeed" in it. Not found in the library included.
     
  10. HotShoe

    HotShoe Well-Known Member Licensed User

    Thanks, I'll change that.

    --- Jem
     
  11. mr23

    mr23 Active Member Licensed User

    Subsequently I found that I think you meant to have:

    dblbl.Text = wifi.getWifiSignal & " DB" ' instead of .getWifiLinkSpeed
     
  12. daniel69

    daniel69 Member Licensed User

    Well done @HotShoe ! I've just played with your lib ... really impressive!
     
  13. HotShoe

    HotShoe Well-Known Member Licensed User

    Thank you sir.
     
  14. Harris

    Harris Well-Known Member 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.

    Code:
    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: Sep 7, 2014
  15. HotShoe

    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
     
  16. Harris

    Harris Well-Known Member Licensed User

    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
     
  17. HotShoe

    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
     
  18. Harris

    Harris Well-Known Member 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
     
    HotShoe likes this.
  19. Dadeda

    Dadeda Member Licensed User

    Thanks for your work, your lib is great, keep it up!
     
    HotShoe likes this.
  20. tianya

    tianya Member Licensed User

    thanks
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice