Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AndroidAppmethodCode SnippetDelphiDemoFiremonkey

Read Connected And Nearby Wifi SSID Info In Delphi XE7 Firemonkey On Android

Delphi XE7 Firemonkey Android Wifi InfoDeveloper Erik Salaj from Winsoft has released some demo source code for accessing various pieces of wifi information on Android with Delphi XE7 Firemonkey. The demo includes an Object Pascal wrapper for the Android.Net.Wifi class which allows you to access information about the access point you are connected to and get a list of other access points. The wrapper class was created using the JavaImport for Android tool (also from Winsoft). Specifically you can access the SSID, the BSSID, the MAC address, and possibly more info for the connected access point. Additionally you can iterate through the list of scan results for near by access points and display the SSID, BSSID, capabilities, frequency, and signal level of each nearby access point. The code should also compile for Appmethod. This demo is entirely free and comes with source code. Here a code snippet from the demo app:
    ConnectionInfo := WifiManager.getConnectionInfo;
Memo.Lines.Add('Connection info');
Memo.Lines.Add('  SSID: ' + JStringToString(ConnectionInfo.getSSID));
Memo.Lines.Add('  BSSID: ' + JStringToString(ConnectionInfo.getBSSID));
Memo.Lines.Add('  MAC address: ' + JStringToString(ConnectionInfo.getMacAddress));
ScanResults := WifiManager.getScanResults;
for I := 0 to ScanResults.size - 1 do
begin
Memo.Lines.Add('');
Memo.Lines.Add('Detected access point ' + IntToStr(I));
ScanResult := TJScanResult.Wrap((ScanResults.get(I) as ILocalObject).GetObjectID);
Memo.Lines.Add('  SSID: ' + JStringToString(ScanResult.SSID));
Memo.Lines.Add('  BSSID: ' + JStringToString(ScanResult.BSSID));
Memo.Lines.Add('  Capabilities: ' + JStringToString(ScanResult.capabilities));
Memo.Lines.Add('  Frequency: ' + IntToStr(ScanResult.frequency) + 'MHz');
Memo.Lines.Add('  Signal level: ' + IntToStr(ScanResult.level) + 'dBm');
end

Head over and download the full demo of the Wifi information demo in Delphi XE7 Firemonkey.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts
FiremonkeyPythonShowcase

Desktop AI Image Upscaling with FireMonkey: A Python-Powered Demo

FiremonkeyPythonWindows

Flux 1.1 Pro Desktop GUI Client: Harnessing Generative AI with FireMonkey for Python

DelphiDemoFiremonkeyLinuxOSXShowcaseWindows

AutoBlogAI: FireMonkey Client To Leverage LLMs And Generative AI For Blogging

DelphiFiremonkeyShowcaseUtilityWindows

Unleashing Creativity With Song Writer AI: A Deep Dive

Sign up for our Newsletter and
stay informed

Leave a Reply