开发者

Determining unique Bluetooth MAC address for iPhone and Android

开发者 https://www.devze.com 2023-01-25 00:36 出处:网络
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 ad

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 And开发者_C百科roid would be extremely helpful.


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


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消