2

Is it possible to determine the unique bluetooth MAC address for an iPhone and an Android (and to a lesser extent, other smartphones) from within an app on said device? Is my assumption that the MAC address is universally unique correct?

A general yes or no would be helpful. Example code in the case of an iPhone or an Android would be extremely helpful.

JnBrymn
  • 24,245
  • 28
  • 105
  • 147
  • See my answer on http://stackoverflow.com/questions/2969472/how-can-i-programmatically-get-the-bluetooth-mac-address-of-an-iphone – Carl D'Halluin Sep 27 '11 at 09:19

2 Answers2

3

Yes the bluetooth MAC address will always be unique. In Android you can use the getAddress() api on the BluetoothAdaptor. It returns the MAC address as a String.

On iPhone it looks like there is no public API to read the MAC address , see this thread

Community
  • 1
  • 1
Dennis Mathews
  • 6,897
  • 2
  • 26
  • 39
1

Android

Read up on the Bluetooth section of dev guide, specifically Connecting Devices.

About UUID

A Universally Unique Identifier (UUID) is a standardized 128-bit format for a string ID used to uniquely identify information. The point of a UUID is that it's big enough that you can select any random and it won't clash. In this case, it's used to uniquely identify your application's Bluetooth service. To get a UUID to use with your application, you can use one of the many random UUID generators on the web, then initialize a UUID with fromString(String).

Bryan Denny
  • 27,363
  • 32
  • 109
  • 125
  • 2
    It is my understanding that there is a universally unique identifier associated with all bluetooth devices from the moment they leave the factory door. For instance, also from you link "If a device is discoverable, it will respond to the discovery request by sharing some information, such as the device name, class, and its *unique MAC address*." I am explicitly interested in the MAC address and it had better be universally unique. If my assumption is wrong, then that would be a good thing to know too. – JnBrymn Nov 15 '10 at 23:12