Bluetooth---初步了解Android 蓝牙4.0
http://developer.android.com/reference/android/bluetooth/package-summary.html
android.bluttooth
提供管理蓝牙功能的类,比如对设备的扫描,连接设备,和管理设备之间的传输数据。蓝牙API支持经典蓝牙和低功耗蓝牙。
Provides classes that manage Bluetooth functionality, such as scanning for devices, connecting with devices, and managing data transfer between devices. The Bluetooth API supports both "Classic Bluetooth" and Bluetooth
Low Energy.
有关很多其它的经典蓝牙信息。能够看Bluetooth指南。有关很多其它的低功耗蓝牙的信息,能够看BLE指南。
For more information about Classic Bluetooth, see the Bluetooth guide.
For more information about Bluetooth Low Energy, see the Bluetooth Low Energy (BLE)
guide.
Bluetooth APIs 能够使得应用具备下面功能:
1.对于其它的蓝牙设备的扫描(包含BLE设备)
2.为配对的蓝牙设备查询本地蓝牙适配器
3.建立RFCOMM channels/sockets.
4.连接在其他设备上指定的sockets
5.与其他设备之间数据传输
6.与BLE设备交流。比如接近传感器,心率监视器,健身设备,等等
7.作为GATTclient或GATT服务端
使用这些APIs来完毕蓝牙之间的交流,一个应用程序必须声明BLUETOOTH
权限。对于一些额外的功能。如请求设备发现,也须要BLUETOOTH_ADMIN
权限。
提示:不是全部的Android设备都提供了Bluetooth功能。
The Bluetooth APIs let applications:
- Scan for other Bluetooth devices (including BLE devices).
- Query the local Bluetooth adapter for paired Bluetooth devices.
- Establish RFCOMM channels/sockets.
- Connect to specified sockets on other devices.
- Transfer data to and from other devices.
- Communicate with BLE devices, such as proximity sensors, heart rate monitors, fitness devices, and so on.
- Act as a GATT client or a GATT server (BLE).
To perform Bluetooth communication using these APIs, an application must declare the BLUETOOTH
permission.
Some additional functionality, such as requesting device discovery, also requires the BLUETOOTH_ADMIN
permission.
Note: Not all Android-powered devices provide Bluetooth functionality.
接口:
BluetoothAdapter.LeScanCallback :用来提供LE扫描结果的回调接口
BluetoothProfile:Bluetooth Profiles的公共APIs
BluetoothProfile.ServiceListener:BluetoothProfile
IPC client与service的连接和断开时的一个通知接口
Interfaces
BluetoothAdapter.LeScanCallback | Callback interface used to deliver LE scan results. |
BluetoothProfile | Public APIs for the Bluetooth Profiles. |
BluetoothProfile.ServiceListener | An interface for notifying BluetoothProfile IPC clients when they have been connected or disconnected to the service. |
类:
BluetoothA2dp:这个类提供控制Bluetooth A2DP profile的公共APIs
BluetoothAdapter:代表本地设备的Bluetooth adapter.
BluetoothAssignedNumbers:蓝牙分配号码
BluetoothClass:代表一个Bluetooth类。它描写叙述了设备的一般特征(characteristics)和能力(capabilities)
BluetoothClass.Device:定义全部设备类的常量
BluetoothClass.Device.Major:定义全部主要设备类的常量
BluetoothClass.Service:定义全部服务类的常量
BluetoothDevice:代表一个远程蓝牙设备
=============================================================================================
BluetoothGatt:蓝牙GATT Profile的公共APIs
BluetoothGattCallback:这个抽象类用于实现BluetoothGatt回调
BluetoothGattCharacteristic:代表一个Bluetooth GATT Characteristic.
一个GATT Characteristic是用来构造一个GATT service,BluetoothGattService
的基本数据元素
BluetoothGattDescriptor:代表一个Bluetooth GATT Descriptor.
GATT Descriptor包括一个GATT characteristic,BluetoothGattCharacteristic
的额外信息和属性.
Classes
BluetoothA2dp | This class provides the public APIs to control the Bluetooth A2DP profile. |
BluetoothAdapter | Represents the local device Bluetooth adapter. |
BluetoothAssignedNumbers | Bluetooth Assigned Numbers. |
BluetoothClass | Represents a Bluetooth class, which describes general characteristics and capabilities of a device. |
BluetoothClass.Device | Defines all device class constants. |
BluetoothClass.Device.Major | Defines all major device class constants. |
BluetoothClass.Service | Defines all service class constants. |
BluetoothDevice | Represents a remote Bluetooth device. |
BluetoothGatt | Public API for the Bluetooth GATT Profile. |
BluetoothGattCallback |
This abstract class is used to implement BluetoothGatt callbacks. |
BluetoothGattCharacteristic |
Represents a Bluetooth GATT Characteristic
A GATT characteristic is a basic data element used to construct a GATT service, |
BluetoothGattDescriptor |
Represents a Bluetooth GATT Descriptor
GATT Descriptors contain additional information and attributes of a GATT characteristic, |
BluetoothGattServer | Public API for the Bluetooth GATT Profile server role. |
BluetoothGattServerCallback |
This abstract class is used to implement BluetoothGattServer callbacks. |
BluetoothGattService |
Represents a Bluetooth GATT Service
Gatt Service contains a collection of |
BluetoothHeadset | Public API for controlling the Bluetooth Headset Service. |
BluetoothHealth | Public API for Bluetooth Health Profile. |
BluetoothHealthAppConfiguration |
The Bluetooth Health Application Configuration that is used in conjunction with the BluetoothHealth class. |
BluetoothHealthCallback |
This abstract class is used to implement BluetoothHealth callbacks. |
BluetoothManager |
High level manager used to obtain an instance of an BluetoothAdapter andto conduct overall Bluetooth Management. |
BluetoothServerSocket | A listening Bluetooth socket. |
BluetoothSocket | A connected or connecting Bluetooth socket. |
BluetoothGattServer:Bluetooth GATT Profileserver角色的公共APIs.
BluetoothGattServerCallback:这个抽象类用于实现BluetoothGattServer
回调.
BluetoothGattService:代表一个Bluetooth GATT Service.
================================================================================
BluetoothHeadset:控制蓝牙耳机(Headset)服务的公共API.
BluetoothHealth:蓝牙Health Profile的公共API.
BluetoothHealthAppConfiguration:The Bluetooth
Health Application Configuration(配置)用来与BluetoothHealth
类结合.
BluetoothHealthCallback:用于实现BluetoothHealth
回调的抽象类
BluetoothManager:用来获取BluetoothAdapter
的实例的管理者,进行全面的蓝牙管理
BluetoothServerSocket:一个监听蓝牙的socket
BluetoothSocket:一个已连接或正在连接的蓝牙socket.
Bluetooth---初步了解Android 蓝牙4.0的更多相关文章
- Android 蓝牙4.0 BLE
Android ble (Bluetooth Low Energy) 蓝牙4.0,也就是说API level >= 18,且支持蓝牙4.0的手机才可以使用. BLE是蓝牙4.0的核心Profil ...
- android 蓝牙4.0 开发介绍
最近一直在研究一个蓝牙功能 由于本人是菜鸟 学起来比较忙 一直搞了好久才弄懂 , 网上对蓝牙4.0也就是几个个dome 抄来抄去,全是英文注解 , 对英语不好的朋友来说 真是硬伤 , 一些没必要的描 ...
- Android 蓝牙4.0 BLE (onServicesDiscovered 返回 status 是 129,133时)
Android ble (Bluetooth Low Energy) 蓝牙4.0,也就是说android 4.3+, API level >= 18,且支持蓝牙4.0的手机才可以使用. BLE是 ...
- ym——物联网入口之中的一个Android蓝牙4.0
转载请注明本文出自Cym的博客(http://blog.csdn.net/cym492224103),谢谢支持! 假设还有同学不知道蓝牙4.0能够做什么请查看Android+蓝牙 4.0 将带来什么? ...
- android蓝牙4.0(BLE)开发之ibeacon初步
一个april beacon里携带的信息如下 ? 1 <code class=" hljs ">0201061AFF4C0002159069BDB88C11416BAC ...
- android 蓝牙4.0多通道
很久没记录东西了,前段时间研究了一哈android4.0控制多个外设的情况,注意,需要使用android版本4.3以上,蓝牙4.0及以上. 我这里使用的控制蓝牙灯泡,使用android4.3的手机,手 ...
- Android 蓝牙4.0的连接和通讯
1.加入权限 <uses-sdk android:minSdkVersion=" android:targetSdkVersion="/> <uses-featu ...
- Android蓝牙2.0连接以及数据接收发送
1.加入权限 <uses-feature android:name="android.hardware.bluetooth_le" android:required=&quo ...
- 深入了解Android蓝牙Bluetooth——《进阶篇》
在 [深入了解Android蓝牙Bluetooth--<基础篇>](http://blog.csdn.net/androidstarjack/article/details/6046846 ...
随机推荐
- Android中的MVP架构初探
说来羞愧,MVP的架构模式已经在Android领域出现一两年了.可是到今天自己才開始Android领域中的MVP架构征程. 闲话不多说,開始吧. 一.架构演变概述 我记得我找第一份工作时,面试官问我& ...
- CCNP路由实验之十五 NAT(网络地址转换)
CCNP路由实验之十五 NAT(网络地址转换) 众所周知,要让自己的电脑连上Internet,必须要到运营商(ISP)申请一个上网账号,依据此账号申请自己的宽频业务(拨号上网.商业固定IP等等) ...
- redmine-bug 问题修改流程
1.当我们接受到测试发过来的bug以后,首先就是针对描述,弄清出问题,如果不能重现或者是对问题不清楚,那么可以去找提出者确认 注意:有时候一个问题可能是经过几次重开或者追加提出的,这时候你一定要从头到 ...
- 新技能 get —— 如何校验 md5(windows)
我们在某资源网站上下载完成指定文件后,尤其是一些下载所需较高时长的大型文件,如何检验下载的文件是否完好,也即如何保证和原始网站上的资源一样.此时就要用到检验码的机制,一般文件的下载界面,通常都会给出此 ...
- 洛谷P3374 【模板】树状数组 1(CDQ分治)
题目描述 如题,已知一个数列,你需要进行下面两种操作: 1.将某一个数加上x 2.求出某区间每一个数的和 输入输出格式 输入格式: 第一行包含两个整数N.M,分别表示该数列数字的个数和操作的总个数. ...
- 记2018/4/29 qbxt 测试
记 2018/4/29 qbxt 测试(提高基础班) 简单的 NOIP 模拟赛 竞赛时间: 2018 年 4 月 29 日 13:30-17:00 题目名称 乘法 求和 计数 输入文件名 mul.i ...
- Java Web学习总结(2)——Servlet入门
一.Servlet简介 Servlet是sun公司提供的一门用于开发动态web资源的技术. Sun公司在其API中提供了一个servlet接口,用户若想用发一个动态web资源(即开发一个Java程序向 ...
- STM32W108无线射频模块串行通信接口编程实例
STM32W108无线射频模块UART通信应用实例 基于STM32W108芯片,编写串口測试程序,測试串口通信.完毕PC通过串口与STM32W108进行通信. 开发环境与硬件平台 硬件:STM32W1 ...
- Vue使用Promise自定义confirm确认框组件
使用Promise模拟浏览器确认框,可自定义标题,内容,按钮文字和类型 参数名 类型 说明 title String 标题 content String 内容 yesBtnText String 确认 ...
- 解决Win8/8.1无法正确识别USB3.0的问题
找一个USB3.0的移动硬盘到了手里竟然变成2.0的了!二了! 不能忍啊. 听说是快速启动的问题,但是开机速度快很诱人. 百度了其他解决方法,终于解决了. 下面摘录自: http://blog.csd ...