App Inventor Extensions: WiFi | Pura Vida Apps

App Inventor Extensions


WiFi Manager Extension

See the App Inventor Extensions document about how to use an App Inventor Extension.

For questions about this extension or bug reports please start a new thread in the App Inventor Extensions forum. Thank you.

For feature requests please contact me by email. To be a sponsor of a new method already is possible starting from only 10 USD! With your contribution you will help the complete App Inventor community. Thank you.

Dec 22th, 2015: Version 1: initial release.

July 7th, 2016: Version 2: macAddress method added.

Aug 11th, 2016: Version 2a: avoid DX execution failed error: build each extension separately

Nov 27th, 2016: Version 3: BSSID method added

Feb 25th, 2017: Version 3a: bugfix IllegalArgumentException: Receiver not registered: null while switching screens

May 10th, 2017: Version 3b: bugfix IllegalArgumentException: Receiver not registered while switching screens

Aug 14th, 2017: Version 4: correspondingRSSIs, SignalStrength, ConnectionInfo, Is5GHzBandSupported added

Aug 16th, 2017: Version 5: correspondingBSSIs added

Dec 6th, 2017: Version 5a: bugfix configuredSSIDs, see also here. Thank you Edgar for the error report.

Dec 14th, 2017: Version 5b: bugfix ConnectSSID, see also here. Thank you again Edgar for the error report.

Apr 8th, 2018: Version 6: new method AccessPointIP added

Apr 13th, 2018: Version 7: connect without password

Aug 29th, 2018: Version 8: Disconnect method added

Nov 6th, 2018: Version 9: Dnsservers method added

Jan 23th, 2019: Version 10: SDK 26 update: dangerous permission android.permission.ACCESS_COARSE_LOCATION removed. What is a dangerous permission? The method AvailableSSIDs including its corresponding event have been removed.

Jan 28th, 2019: Version 11: AvailableSSIDs added again. Additionally example project provided about how to use it together with the location sensor and GPS enabled.

Description

Some useful blocks to use in a wireless lan.
Required permissions: android.permission.ACCESS_WIFI_STATE, android.permission.CHANGE_WIFI_STATE

Properties


Returns whether Success Message should be suppressed.


Specifies whether Success Message should be suppressed.


Returns whether Warning Message should be suppressed.


Specifies whether Warning Message should be suppressed.

Methods


Return the local IP Address.
Sponsor of this block is Marius. Thank you!


Return the MAC Address of the device.
Sponsor of this block is Niko. Thank you!


Get current WiFi state: true or false.


Enable WiFi.
You can hide the success message after setting the suppressSuccessMessage property to false.
Note: to be able to test this block, you have to build the app, because the permission CHANGE_WIFI_STATE is not available in the companion app.


Disable WiFi.
You can hide the success message after setting the suppressSuccessMessage property to false.
Note: to be able to test this block, you have to build the app, because the permission CHANGE_WIFI_STATE is not available in the companion app.


Get current WiFi SSID (Service Set Identifier).


Get current WiFi BSSID (the MAC address of the access point).
Thank you burrowmoor for being the sponsor of this method.


Connect to a SSID (Service Set Identifier).
If you provide a non existing SSID or wrong password, this just will be ignored and the device will try to connect to a known SSID instead.
Note: Starting from version 7 it is also possible to connect to an open network, i.e. a SSID, which does not have a password. Thank you Robert for being the sponsor of this enhancement.

Note: to be able to test this block, you have to build the app, because the permission CHANGE_WIFI_STATE is not available in the companion app.


Get a list of configured SSIDs (Service Set Identifiers). WiFi must be enabled for this.


Get a list of available SSIDs (Service Set Identifiers). WiFi must be enabled for this.

Note: to be able to test this block, you have to build the app, because the permission CHANGE_WIFI_STATE is not available in the companion app.

Note: Precondition to use this method is to add a location sensor component into your project. Also GPS must be enabled. See the example project about how to use it..


Get current connection info.
For details, see also WiFiInfo documentation.


Check, if 5 GHz Band is supported. Returns true or false.


Get signal strength (RSSI) in a range between 0 and 100.


Get IP address of the access point.
Thank you Eric for being the sponsor of this method.


Disconnect.
Note: after disconnecting the device might reconnect automatically to the next available known network.
Thank you Wei Zheng for being the sponsor of this method.


Return a list of DNS servers (primary and secondary) of the current network.
Note: The method returns the IP address of the gateway router when DNS is not configured inside the router.
Thank you Gabriel for being the sponsor of this method.

Events


Event indicating that Available SSIDs (Service Set Identifiers) have been scanned.
A list of the available SSIDs is provided in parameter availableSSIDs. The SSID having the best signal is provided in parameter bestSSID. A list of the corresponding RSSIs is provided in parameter correspondingRSSI. A list of corresponding BSSIs is provided in parameter correspondingBSSIs.
Thank you Tal for being the sponsor of the correspondingRSSI and correspondingBSSI functionality.

Example App: WiFi Test


Example App: Get Available SSIDs

Note: Precondition to use the AvailableSSID method is

  1. to add a location sensor component into the project
  2. to enable GPS and
  3. to build the app to test its functionality



Screenshot

Test

Tested successfully on Samsung Galaxy A5 (2017) running Android 8.0.

For questions about App Inventor,
please ask in the App Inventor forum.Thank you.

Terms and Conditions

Download


Developing and maintaining snippets, tutorials and extensions for App Inventor takes a lot of time.
I hope it saved some of your time. If yes, then you might consider to donate a small amount!

Donation amount:

or donate some mBTC to Bitcoin Address:
1Jd8kXLHu2Vkuhi15TWHiQm4uE9AGPYxi8
Bitcoin

Thank you! Taifun
 

Download TaifunWiFi extension (aix file)
Download WiFi Test (aia file)
Download Available SSIDs Test (aia file)
Back to top of page ...

Creative Commons License
This work by Pura Vida Apps is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
with attribution (name=Pura Vida Apps and link to the source site) required.


Home | Snippets | Tutorials | Extensions | Links | Search | Privacy Policy | Contact