25 Haziran 2014 Çarşamba

Delphi Android ve IOS Mac adresi bulma

Örnek Resim

ANDROID:
WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
WifiInfo wInfo = wifiManager.getConnectionInfo();
String macAddress = wInfo.getMacAddress();


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

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;