The author introduces This example here is the Google SDK provides a Bluetooth chat program, simple but the information is huge, very suitable for beginners to learn Bluetooth knowledge.
Before learning This example, please read and understand the working principle and implementation mechanism of the socket, the author of this blog has a detailed description:
http://blog.csdn.net/dlutbrucezhang/article/details/8577810
In the android1.x, the relevant API is very imperfect, not easy to use Bluetooth development, there is an open source project can help programmers use, develop Bluetooth, support direct method Bluetooth protocol stack. After Android2, the framework provides some official APIs for Bluetooth communication, but the current program is less sophisticated. This article mainly discusses the API usage of Bluetooth communication after Android2.
First look at the chat room effect chart:
The process of connecting a Bluetooth device is shown in the following illustration:
The following diagram shows a sequence diagram of a Bluetooth chat: