官方介绍的Bluetooth

https://developer.android.com/guide/topics/connectivity/bluetooth

使用Bluetooth APIs 可以做到:
Scan for other Bluetooth devices. 扫瞄蓝芽装置
Query the local Bluetooth adapter for paired Bluetooth devices. 查询并配对
Establish RFCOMM channels. 建立通讯
Connect to other devices through service discovery. 使用Service 采索进行连线
Transfer data to and from other devices. 传输档案
Manage multiple connections. 管理多装置

使用蓝芽连线主要有个步骤(基本要求工作):
Setting up Bluetooth.
Finding devices that are either paired or available in the local area.
Connecting devices.
Transferring data between devices.

在android.bluetooth 提供的功能,有以下几个主要的类别:

  • BluetoothAdapter
  • BluetoothDevice
  • BluetoothSocket
  • BluetoothServerSocket
  • BluetoothClass
  • BluetoothProfile
  • BluetoothHeadset
  • BluetoothA2dp
  • BluetoothHealth
  • BluetoothHealthCallback
  • BluetoothHealthAppConfiguration
  • BluetoothProfile.ServiceListener

连线时,主要两个步骤:

  1. Get the BluetoothAdapter
  2. Enable Bluetooth
  3. Get a BluetoothServerSocket by calling listenUsingRfcommWithServiceRecord().
  4. Start listening for connection requests by calling accept().
  5. Unless you want to accept additional connections, call close().

<<:  Day#19 Firebase database 101

>>:  [Q&A] 04 专案必要文件难产

[Day16]What is Merkle tree?

这篇会分成4个部分,分别是介绍merkle tree以及各种待会会用到的名词、实际看merkle ...

Day 10 [Python ML、特徵工程] 特徵生成

汇入基线模型(Baseline model) %matplotlib inline import m...

DAY 21 新增查询与删除团购讯息

管理讯息的功能有 新增团购讯息 删除团购讯息 查询团购讯息 手动新增团购者 手动删除团购者 新增团购...

Day 19 To Do List - 加入逻辑 2

第 19 天~ 昨天做到了,新增项目的部分, 像这样: 改变状态 当我们可以成功的展示新增的项目後,...

# Day18--如果我早一点追求MVC小姊姊,我就不会乱写了

据说设计模式有很多种⋯⋯而MVC是超级常用的一种,在还没有物件导向的概念、或者是值型别、参考型别的概...