1

I need to retrieve all available MAC addresses available in the current mobile device, and if possible the currently active network card IP address.

  • How can I get the currently active network card MAC and IP address in Delphi XE5 / XE6 ?
Sir Rufo
  • 18,395
  • 2
  • 39
  • 73
Yordan Yanakiev
  • 2,546
  • 3
  • 39
  • 88
  • 1
    I think [this post][1] will clear things up for you! [1]: http://stackoverflow.com/questions/677530/how-can-i-programmatically-get-the-mac-address-of-an-iphone – Calle Bergström Jun 02 '14 at 14:05
  • @user3631728: comments do not support reference-style links, use inline links instead. When adding a new comment, click on the `help` link to see the proper syntax. – Remy Lebeau Jun 02 '14 at 15:55

3 Answers3

3

Following up @wholegrain's answer and this info from the link posted by @user3631728 How can I programmatically get the MAC address of an iphone:

"In iOS 7 and later, if you ask for the MAC address of an iOS device, the system returns the value 02:00:00:00:00:00. If you need to identify the device, use the identifierForVendor property of UIDevice instead. (Apps that need an identifier for their own advertising purposes should consider using the advertisingIdentifier property of ASIdentifierManager instead.)"

if this this would be suffice, you can do something like this for IOS:

Uses
  {$IFDEF IOS}
    iOSApi.UIKit;
  {$ENDIF}

procedure TForm1.Button2Click(Sender: TObject);
var
  {$IFDEF IOS}
    Device    : UIDevice;
  {$ENDIF}
begin
  {$IFDEF IOS}
    Device := TUIDevice.Wrap(TUIDevice.OCClass.currentDevice);
    ShowMessage(Device.uniqueIdentifier.UTF8String);
    ShowMessage(Device.identifierForVendor.UUIDString.UTF8String);
  {$ENDIF}
end;
Community
  • 1
  • 1
ThisGuy
  • 1,405
  • 1
  • 24
  • 51
1

For Android:

WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
WifiInfo wInfo = wifiManager.getConnectionInfo();
String macAddress = wInfo.getMacAddress(); 
Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Kshitij
  • 144
  • 10
1

Since iOS7, its not possible to retrieve device's Mac address.

tcacciatore
  • 483
  • 6
  • 21