I am doing an Android App and where I have the MAC of another device as a string (17 characters long) and need to use that one in order to connect to that device (thread tha
First you will have to findout what profile the bluetooth device supports, For instance it could be a medical device that could use HDP profile or it could be using a simple RS232 over bluetooth. It is important to understand how the bluetooth connection is established for various profiles before you start writing code.
Here is a good link to start with. Android SDK also comes withe some basic examples that you can start with.
http://developer.android.com/guide/topics/connectivity/bluetooth.html
EDIT:
If your device is paired successfully,you will see the MAC address in the list of paired devices. For instance, you can do this to find the device that matches your device's MAC address :
Set pairedDevices = mBluetoothAdapter
.getBondedDevices();
if (pairedDevices.isEmpty()) {
Log.e(TAG,
"No devices paired...");
return ;
}
for (BluetoothDevice device : pairedDevices) {
Log.d(TAG, "Device : address : " + device.getAddress() + " name :"
+ device.getName());
if (MY_MAC_ADDR.equals(device.getAddress())) {
mDevice = device;
break;
}
}
Hope that helps.