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 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOS

Delphi XE7 Firemonkey Android Wifi Info | Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOSDeveloper 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
DelphiDemoFiremonkeyLinuxOSXShowcaseWindows

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

DelphiFiremonkeyShowcaseUtilityWindows

Unleashing Creativity With Song Writer AI: A Deep Dive

DelphiFiremonkeyShowcaseWindows

How To Build Stable Diffusion Text To Image Prompts

AndroidC++BuilderDelphiFiremonkeyIOSOSXWindows

FireMonkey 10.4.2 Features Updated iOS 14, Android 11, And macOS 11 Support Plus Hundreds Of Fixes

Sign up for our Newsletter and
stay informed

Leave a Reply