Access WIFI Device Info Like SSID And IP Address In Delphi XE6 Firemonkey On Android

Delphi XE6 Firemonkey WIFI State AndroidDeveloper Andrey Yefimov has a blog post up in Russian with an example of reading the WIFI state using the JNI on Android in Delphi XE6 Firemonkey. The example uses the following Android permissions: ACCESS_WIFI_STATE, CHANGE_WIFI_STATE, and
CHANGE_WIFI_MULTICAST_STATE. The wrapper makes the following information available: wifi enabled, wifi state, and ping supplicant. Plus the following additional information: BSSID, HiddenSSID, ip address, link speed, mac address, network ID, RSSI, SSID, and supplicant state. It also shows an example of listing the access point SSIDs which are in range of your Android device. The wrapper is a unit called Androidapi.JNI.Net.Wifi. Here is the sample code for reading the wifi information with the wrapper:

The original blog post is in Russian so use Google Chrome to translate. This code should also work in AppMethod.

Head over and check out the full blog post for reading the wifi state using the JNI in Delphi XE6 Firemonkey on Android.

Or download a mirror of the WIFI State JNI example.

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

6 Responses to Access WIFI Device Info Like SSID And IP Address In Delphi XE6 Firemonkey On Android

  1. Flash Thunder says:

    Is there any way to scan available networks and list them with RSSI?

  2. Fabio L. says:

    ip := WifiInfo.GetIPAddress;
    Result := Format(‘%d.%d.%d.%d’, [ip and $FF, ip shr 8 and $FF, ip shr 16 and $FF, ip shr 24 and $FF]);
    for get normal ip address

  3. olesio says:

    Hello. Can you give example of Delphi XE8 code for use TrafficStats and getTotalTxBytes to monitor WIFI transfer? Thanks in advance. I’m totally Android newbie :/ Regards.

  4. Mike says:

    This code appears to work fine for Lollipop, but not Oreo. Any tips for getting this to work on Oreo?

Leave a Reply

Show Buttons
Hide Buttons
Read previous post:
Complete BaaS Login System Example For Delphi XE6 Firemonkey On Android And IOS

Sarina DuPont from Embarcadero has a new blog post up expanding on BaaS user management with Kinvey in Delphi XE6...