So I know that in Android I can get an incoming connection by simply using listenUsingRfcommWithServiceRecord(String, UUID).
but I'm just wondering if there is a way to set up a BraodcastReceiver
or something that gets notified every time a device connects via bluetooth to our phone and get the UUID out of the incoming Intent. Is there any way to do this?
Asked
Active
Viewed 879 times
0

tshepang
- 12,111
- 21
- 91
- 136

AxiomaticNexus
- 6,190
- 3
- 41
- 61
1 Answers
1
You can monitor the bluetooth connection (listening to Broadcast action : ACTION_ACL_CONNECTED) and notify that the connection. Also checkout
How to programmatically tell if a Bluetooth device is connected? (Android 2.2)
Finally checkout Bluetooth Device from the Android Docs to get more information about it.

Community
- 1
- 1

Lalit Poptani
- 67,150
- 23
- 161
- 242
-
Alrighty, that is one mystery solved, but how do I get a hold of the UUID though. In my broadcast receiver I don't want to mess with connections from another app, so I want to compare the incoming UUID with that of my app before doing anything. – AxiomaticNexus Nov 25 '11 at 05:04