BluetoothChat 基本

Bluetooth 设备通过初始配对过程建立安全连接。在此期间,一个或两个设备需要输入PIN 码,内部算法利用该代码生成安全密钥,安全密钥随后用于验证将来任何时候的设备连接

  • Scanning for other Bluetooth devices
  • Querying the local Bluetooth adapter for paired Bluetooth devices
  • Establishing RFCOMM channels/sockets
  • Connecting to a remote device
  • Transfering data over Bluetooth


The basic

  1. Bluetooth Permissions
  2. Setting Up Bluetooth
  3. Finding Devices
    1. Querying paired devices
    2. Discovering devices
  4. Connecting Devices
    1. Connecting as a server
    2. Connecting as a client
  5. Managing a Connection


The Skill

1.

(1)多线程应用程序

http://docs.oracle.com/javase/tutorial/essential/concurrency/


(2)异步asynchronous


(3)同步synchronized


(4)状态管理


2.广播

在发现蓝牙的过程中,应用程序需要开启广播来接收被发现到的蓝牙设备。

3.蓝牙服务器和客户端

4.封装为一个蓝牙服务器

       This class does all the work for setting up and managing Bluetooth connections with other devices. It hasa thread that listens for incoming connections, a threadfor connecting with a device, and a thread for performing data transmissions when connected.
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值