Skip to main content
Known Participant
October 22, 2011
Answered

Getting android identification ID from a device

  • October 22, 2011
  • 1 reply
  • 1109 views

He there.

I have a very specific question about air on android devices.

Would there exist a way to retrieve ANY hardware identification ID from an android device ?

That may be a serial number, but it may also be anything else as long as the ID can be used to identify a machine.

Kind regards,

Bart

This topic has been closed for replies.
Correct answer boat5

See Network interfaces example code here:

http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b8f6c0-7ffe.html

Last I checked the WIFI  MAC address is accessible on android (aka hardware address). I do not remember if you need WIFI permissions set in the descriptor...probably do.

1 reply

boat5Correct answer
Inspiring
October 22, 2011

See Network interfaces example code here:

http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b8f6c0-7ffe.html

Last I checked the WIFI  MAC address is accessible on android (aka hardware address). I do not remember if you need WIFI permissions set in the descriptor...probably do.

Known Participant
October 23, 2011

This piece of code indeed returned me the MAC address of the android device.

It also looks like this address is always available. I checked this with

1) MOBILE DATA ON + WIFI ON

2) MOBILE DATA OFF + WIFI ON

3) MOBILE DATA ON + WIFI OFF

4) MOBILE FATA OFF + WIFI OFF

It returns always a mac address

import flash.display.Sprite;
import flash.net.InterfaceAddress;
import flash.net.NetworkInfo;
import flash.net.NetworkInterface;

var networkInfo:NetworkInfo = NetworkInfo.networkInfo;
var interfaces:Vector.<NetworkInterface >  = networkInfo.findInterfaces();

if ( interfaces != null )
{
informatie.appendText( "Interface count: " + interfaces.length +'\n');
for each (var interfaceObj:NetworkInterface in interfaces)
{
  informatie.appendText( "\nname: "             + interfaceObj.name +'\n');
  informatie.appendText( "display name: "     + interfaceObj.displayName+'\n' );
  informatie.appendText( "mtu: "                 + interfaceObj.mtu +'\n');
  informatie.appendText( "active?: "             + interfaceObj.active +'\n');
  informatie.appendText( "parent interface: " + interfaceObj.parent +'\n');
  informatie.appendText( "hardware address: " + interfaceObj.hardwareAddress +'\n');
  if (interfaceObj.subInterfaces != null)
  {
   informatie.appendText( "# subinterfaces: " + interfaceObj.subInterfaces.length +'\n');
  }
  informatie.appendText("# addresses: "     + interfaceObj.addresses.length +'\n');
  for each (var address:InterfaceAddress in interfaceObj.addresses)
  {
   informatie.appendText( "  type: "           + address.ipVersion +'\n');
   informatie.appendText( "  address: "         + address.address +'\n');
   informatie.appendText( "  broadcast: "         + address.broadcast +'\n');
   informatie.appendText( "  prefix length: "     + address.prefixLength +'\n');
  }
}
}

Is there anyone else who is willing to have a try on this code and see if it also works on his device (and post it here on this thread) ?

This would be a very interesting way of identifying individual users by their mac address but for that we would have to be sure that it works on a multitude of devices

A little demo app which retrieves this info can be downloaded from www.cyberklas.com/geluid/androidid.apk

Kind regards,

Bart