android bluetooth can't connect

后端 未结 2 841
执念已碎
执念已碎 2021-01-31 00:52

I\'ve been having this problem for a while and haven\'t been able to figure it out.

I have a android application that puts all paired devices in a listview. When you cl

2条回答
  •  轮回少年
    2021-01-31 01:17

    The jelly bean bluetooth stack is markedly different from the other versions.

    This might help: http://wiresareobsolete.com/wordpress/2010/11/android-bluetooth-rfcomm/

    In gist: The UUID is a value that must point to a published service on your embedded device, it is not just randomly generated. The RFCOMM SPP connection you want to access has a specific UUID that it publishes to identify that service, and when you create a socket it must match the same UUID.

    If you are targeting 4.0.3 device and above , use fetchUuidsWithSdp() and getUuids() to find all the published services and their associated UUID values. For backward compatibility read the article

提交回复
热议问题