velazcod
velazcod

Reputation: 1014

Get the Bluetooth MAC Address of a Blackberry device

I'd like to get the Bluetooth MAC Address of the device the app is running on, even when it's not connected to another BT device. Is this even possible? Can you even turn on/off the Bluetooth radio via an API?

I'm not familiar with the Blackberry SDK, but I am familiar with Android and iOS. I'm aware that it's not possible on iOS because the API is not exposed (unless you are rooted). I know very well how to do it on Android.

Can somebody point me in the right direction? I will either learn to deal with the Blackberry SDK or hire somebody to do the work for the app I need, but I want to be a little bit familiar with this.

Upvotes: 0

Views: 652

Answers (1)

Vivart
Vivart

Reputation: 15303

I think we can user getDeviceAddress() method to get device address. this method returns data in byte array.

BluetoothSerialPortInfo[] info = BluetoothSerialPort.getSerialPortInfo();
byte[] btAddress = info[0].getDeviceAddress();

We need to convert this byte array to hex.

ByteArrayUtilities.byteArrayToHex();

Upvotes: 3

Related Questions