Skip to main content
Known Participant
Oct 22, 2011 4:01 PM UTC
Answered

Getting android identification ID from a device

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 is closed to new replies. Start a new post to keep the conversation going.
boat5Correct answer
Inspiring
Oct 22, 2011 11:44 PM UTC

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.

2 replies

boat5Correct answer
Inspiring
Oct 22, 2011 11:44 PM UTC

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.

Translate
Known Participant
Oct 23, 2011 9:08 PM UTC

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

Translate