Mike D
Mike D

Reputation: 4946

Scanning for a Specific Bluetooth Device on Android

I have found this question about scanning for Bluetooth device, which pretty much mirrors the Android docs, but I find that is good when the phone (or tablet) has not previously been paired with another (in my case a Point of Sale terminal).

However, after pairing has occurred, and relevant data about the POS stored (name and address), how would I go about establishing a connection directly to the POS (or another device where the name and address is known) without going through the discovering process again? I find the Android docs a bit lacking in this aspect.

Upvotes: 0

Views: 2542

Answers (1)

Dennis Mathews
Dennis Mathews

Reputation: 6975

You can use the getRemoteDevice(String address) on the BluetoothAdaptor to get the BluetoothDevice Object for the remote device specified in address.

Then you can connect to that device using

public BluetoothSocket createRfcommSocketToServiceRecord (UUID uuid)

Upvotes: 1

Related Questions