I am writing an Android application (ICS 4.0.3) to detect devices and list their UUIDs.
The application detects the Bluetooth device, and when it finds the device, it saves it. Once the device discovery is complete, it will return through all the saved devices and execute fetchUUidsWithSdp (), and then print the found UUIDs in the broadcast receiver.
When the application starts, I get every two sets of responses, each of which contains all the UUIDs on all detected devices.
Is this the way it should work?
In the documentation, I see that:
If an error occurs while retrieving SDP records, or if the process takes a long time, the intent ACTION_UUID is sent with the UUID that is currently in the cache.
Both sets of answers come pretty quickly, but I think the first one can be from the cache, and the second from the remote device.
The code can be found at http://digitalhacksblog.blogspot.com/2012/05/android-example-bluetooth-discover-and.html .
digitalhack
source share