Android Developer -- Bluetooth篇 概述
Bluetooth
安卓平台支持蓝牙网络协议栈,它允许设备与其他蓝牙设备进行无线交换数据。应用程序框架通过安卓蓝牙APIs提供访问蓝牙功能。这些APIs使应用程序通过无线连接到其他蓝牙设备,使点对点和多点的无线功能。
使用蓝牙APIs,安卓应用程序可以执行以下功能:
- 扫描其他蓝牙设备
- 查询本地蓝牙适配器,用于配对蓝牙设备
- 建立RFCOMM通道
- 通过发现服务service discovery连接到其他设备
- 交换数据和其他设备
- 管理多个连接
The Basics
这个文档描述了如何使用Android Bluetooth APIs去完成四个主要任务去使用Bluetooth交流:安装Bluetooth,查找配对的设备或者在本地可用的设备,连接设备,在设备间交换数据。
所有类都在android.bluetooth这个包,这里是类的一个总览:
BluetoothAdapter
代表本地蓝牙适配器(蓝牙监听者),BluetoothAdapter是所有使用Bluetooth对话的入口。使用它可以发现其他Bluetooth设备,查找已经配对的设备的列表,初始化一个BluetoothDevice使用一个知道的MAC地址,创建一个BluetoothServerSocket去监听其他设备来进行通信
BluetoothDevice
代表了远程的Bluetooth设备。远程设备使用它来通过BluetoothSocket发起一个连接或者或者查询设备的名字,地址 ,类名和配对状态
BluetoothSocket
用来通过InputStream和OutputStream交换数据
BluetoothServerSocket
用来监听请求,两个设备为了连接,一个设备必须打开一个server socket通过这个类,当远程蓝牙设备发起一个连接来连接这个设备,BluetoothServerSocket会返回一个已经连接的BluetoothSocket当连接接受时
BluetoothClass
描述蓝牙设备的一般特性和功能。这是一组只读的属性,定义设备的主要和次要设备类及其服务。然而,这并不能可靠地描述设备所支持的所有蓝牙配置文件和服务,但对设备类型的提示是有用的。
BluetoothProfile
表示蓝牙配置文件的接口。蓝牙配置文件是一种基于蓝牙的设备之间的无线接口规范。一个例子是Hands-Free profile。对于配置文件的更多讨论,see Working with Profiles(看官网的链接)
BluetoothHeadset
提供了蓝牙耳机支持
BluetoothA2dp
定义如何将高质量的音频通过蓝牙连接从一个设备传输到另一个设备。”A2DP”代表先进的音频分布。
BluetoothProfile.ServiceListener
一个接口,通知bluetoothprofile IPC客户端,当他们已连接或断开了与服务(即内部服务运行一个特定的配置文件)。
Android Developer -- Bluetooth篇 概述的更多相关文章
- Android Developer -- Bluetooth篇 开发实例之四 API详解
http://www.open-open.com/lib/view/open1390879771695.html 这篇文章将会详细解析BluetoothAdapter的详细api, 包括隐藏方法, 每 ...
- Android Developer -- Bluetooth篇 开发实例之一 扫描设备
第一步:声明Bluetooth Permissions <!-- 设置蓝牙访问权限 --> <uses-permission android:name="android.p ...
- Android Developer -- Bluetooth篇 开发实例之三 管理连接
Managing a Connection When you have successfully connected two (or more) devices, each one will have ...
- Android Developer -- Bluetooth篇 开发实例之二 连接设备
连接设备 In order to create a connection between your application on two devices, you must implement bot ...
- Bluetooth篇 开发实例之九 和蓝牙模块通信
首先,我们要去连接蓝牙模块,那么,我们只要写客户端的程序就好了,蓝牙模块就相当于服务端. 连接就需要UUID. #蓝牙串口服务SerialPortServiceClass_UUID = ‘{00001 ...
- 【Android应用开发】Android 蓝牙低功耗 (BLE) ( 第一篇 . 概述 . 蓝牙低功耗文档 翻译)
转载请注明出处 : http://blog.csdn.net/shulianghan/article/details/50515359 参考 : -- 官方文档 : https://develope ...
- 深入了解Android蓝牙Bluetooth——《进阶篇》
在 [深入了解Android蓝牙Bluetooth--<基础篇>](http://blog.csdn.net/androidstarjack/article/details/6046846 ...
- 深入了解Android蓝牙Bluetooth ——《总结篇》
在我的上两篇博文中解说了有关android蓝牙的认识以及API的相关的介绍,蓝牙BLE的搜索,连接以及读取. 没有了解的童鞋们请參考: 深入了解Android蓝牙Bluetooth--<基础篇& ...
- Android中插件开发篇总结和概述
刚刚终于写完了插件开发的最后一篇文章,下面就来总结一下,关于Android中插件篇从去年的11月份就开始规划了,主要从三个方面去解读Android中插件开发原理.说白了,插件开发的原理就是:动态加载技 ...
随机推荐
- sshd_config_for_centos
# $OpenBSD: sshd_config,v // :: djm Exp $ # This is the sshd server system-wide configuration file. ...
- diskimage-builder
Supported Distributions Distributions which are supported as a build host: Centos 6, 7 Debian 8 (“je ...
- 使用UltraEdit搭建自己的C/C++ IDE
使用UltraEdit搭建自己的C/C++ IDE CodeBlocks的13.12版本啊,主要缺点是启动慢,而且在Windows上容易假死,写着写着就无响应了,然后死活活不过来.所以没办法,只好干脆 ...
- 第一章 C++编程基础
第一章 C++编程基础 1.1 如何撰写C++程序 赋值 assignment复合赋值 (compound assignment) += 函数(function)是一块独立的程序代码序列(code s ...
- 通过设计表快速了解sql语句中字段的含义
打开Navicat-------> 选择数据库 ------->右键设计表------>查看下方注释
- excel模板解析—桥接模式:分离解析模板和业务校验
在做excel模板解析的时候,其实会有两个部分,第一,将模板读取出来,校验一些必录项等. 但除了这些,在数据真正被业务线使用的时候,还会有一些其他的校验,比如说:根据业务,年龄是不能超过多少岁的,包括 ...
- poj 1035 纯正的字符串水
Spell checker Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 22673 Accepted: 8258 De ...
- table纵横都需要下拉框
table 溢出,下拉框显示不全 <div class="table-scrollable"style="height: 500px; overflow-y: vi ...
- 实用JS系列——BOM常用对象
背景: 最近在着手项目的时候,意识到自己JS的欠缺.虽然看了不少JavaScript的视频,但真正项目中并不是经常遇到大且难的例子.所以JavaScript的基础还需要再打扎实,也就有了这一系列博客 ...
- weex & web app & vue
weex & web app & vue https://weex-project.io/tools/playground.html https://weex.apache.org/ ...