Reputation: 25353
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.
Upvotes: 2
Views: 7599
Reputation: 6975
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
Upvotes: 3
Reputation: 27596
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).
Upvotes: 1