Bluetooth in Android 4.2 and 4.3(一):综述
从Android 4.2开始,Bluetooth stack发生了重大改变:从Bluez换成了由Google和Broadcom联合开发的Bluedroid(当然,核心的部分还是Broadcom的,Google主要是做了和上层Framework相关的部分)。通过http://source.android.com/devices/bluetooth.html可以大概了解新的Bluetooth stack的架构,总的来说相关文档很少,主要靠阅读代码进行深入了解。
Bluedroid和Bluez相比,有如下优点:
- 层次结构清晰。各个profile对上层接口统一,便于增加新的profile;增加了HAL层,便于移植。
- 去掉了DBus,Framework的Java代码直接调用到Bluedroid的Native代码。
但是Android 4.2中的Bluedroid与Android 4.1中的Bluez相比,功能要少,例如不支持AVRCP 1.3; Bug较多,例如某些蓝牙耳机不能重拨最后一个电话。最重要的是4.2的Bluedroid不支持BLE。不过在刚刚发布的Android 4.3中已经有了很多改进,AVRCP 1.3和BLE都得到了支持。
目前有一些Android 4.1或4.2的设备是支持BLE的,但是都是采用的Vendor自己的解决方案,比如Bluetooth stack采用Bluez 5.x,再提供Vendor BLE Android SDK. 现在Android 4.3已经发布,从未来发展趋势来看,如果有人要学习Bluetooth in Android,建议不要再研究Bluez,最好转向Bluedroid。
以下是Android 4.2中Bluetooth相关代码之分布:
| android.bluetooth | frameworks/base/core/java/android/bluetooth | implements public API for the Bluetooth adapter and profiles |
| Bluetooth system service | packages/apps/Bluetooth/src | implements service and profiles at the Android fraework layer |
| Bluetooth JNI | packages/apps/Bluetooth/jni | defines Bluetooth adapter and profiles service JNI: calls into HAL and receives callback from HAL |
| Bluetooth HAL | hardware/libhardware/include/hardware/bt_*.h files | defines the standard interface that the android.bluetooth adapter and profiles APIs |
| Bluetooth stack | external/bluetooth/bluedroid | implement bluetooth stack: core and profiles |
以Pan profile为例,我们可以看看代码的具体分布和类及文件的命名方式:
| android.bluetooth | frameworks | public class BluetoothPan implements BluetoothProfile |
| Bluetooth System Service | packages/apps | public class PanService extends ProfileService |
| Bluetooth JNI | packages/apps | com_android_bluetooth_pan.cpp |
| Bluetooth HAL | hardware/libhardware | include/hardware/bt_pan.h |
| Bluetooth stack | external/bluetooth | bluedroid/btif/src/btif_pan.c(implements bt_pan.h) |
| bluedroid/bta/pan (Broadcom BTA) | ||
| bluedroid/stack/pan (Broadcom BTE) |
Bluetooth in Android 4.2 and 4.3(一):综述的更多相关文章
- Bluetooth in Android 4.2 and 4.3(三):Enable Bluetooth
以下是基于Android 4.2代码,对Bluetooth BR/EDR Enable process的分析.BluetoothAdapter类代表的是local device Bluetooth a ...
- Android使用BLE(低功耗蓝牙,Bluetooth Low Energy)
背景 在学习BLE的过程中,积累了一些心得的DEMO,放到Github,形成本文.感兴趣的同学可以下载到源代码. github: https://github.com/vir56k/bluetooth ...
- android -- 蓝牙 bluetooth (四)OPP文件传输
在前面android -- 蓝牙 bluetooth (一) 入门文章结尾中提到了会按四个方面来写这系列的文章,前面已写了蓝牙打开和蓝牙搜索,这次一起来看下蓝牙文件分享的流程,也就是蓝牙应用opp目录 ...
- android 蓝牙连接与通讯(Bluetooth)
最近做了一个小项目,关于蓝牙的一个智能硬件.其中涉及到了蓝牙模块的操作.特记下蓝牙模块的操作过程.只记录下关于蓝牙部分的操作,具体业务逻辑不涉及其中.重点是记录下蓝牙的扫描.链接.通讯. 在使用蓝牙模 ...
- 深入了解Android蓝牙Bluetooth——《进阶篇》
在 [深入了解Android蓝牙Bluetooth--<基础篇>](http://blog.csdn.net/androidstarjack/article/details/6046846 ...
- 【Android 应用开发】Android之Bluetooth编程
Android Bluetopth 编程大牛文章 http://my.oschina.net/u/994235/blog?catalog=313604 ViewGroup 相关资料 : http:// ...
- Android BLE与终端通信(二)——Android Bluetooth基础科普以及搜索蓝牙设备显示列表
Android BLE与终端通信(二)--Android Bluetooth基础搜索蓝牙设备显示列表 摘要 第一篇算是个热身,这一片开始来写些硬菜了,这篇就是实际和蓝牙打交道了,所以要用到真机调试哟, ...
- Android BLE与终端通信(一)——Android Bluetooth基础API以及简单使用获取本地蓝牙名称地址
Android BLE与终端通信(一)--Android Bluetooth基础API以及简单使用获取本地蓝牙名称地址 Hello,工作需要,也必须开始向BLE方向学习了,公司的核心技术就是BLE终端 ...
- Android学习笔记——Bluetooth的使用
蓝牙应该是现在每一部智能手机的标配了.想当年在山寨机横行的年代里,蓝牙都可以做为一个卖点~~~ 废话不多说了,进入正题: 使用蓝牙功能是需要权限的,关于蓝牙的权限也就两个: <uses-perm ...
随机推荐
- nanakon
1.安装python pip3 install tornado pip3 install pymysql pip3 install qiniu pip3 install pillow 2.安装mysq ...
- 【自动化测试】Selenium - 定位
http://easonhan007.github.io/selenium/2014/01/10/se-secret_01/ 你应该遵照这个规则来选择定位元素的属性.name > id > ...
- JS面向对象组件(三)--面向对象中的常用属性和方法
图片的由来看下面: 1.hasOwnProperty:看是不是对象自身下面的属性 var arr = []; arr.num = ; Array.prototype.num2 = ; //所有的数组对 ...
- Java常用类:String
一.介绍 String:不可变的Unicode字符序列 例如:"Java" 就是4个Unicode字符J,a,v,a组成的 Java没有内置的字符串类型,而是在标准的J ...
- unity, 在保持场景根节点Transform不变且Hierarchy结构不变的前提下整体旋转场景
比如我们摆出下面结构: 其Hierarchy如下: 其中根节点road的Transform是如下干净的原始状态: 现在想保持road的Hierarchy和Transform都不变的情况下将road旋转 ...
- 挺好看的CSS
<?php header("content-type:text/html;charset=utf-8"); echo "<style>h1{ color ...
- 嵌入式 arm平台ping域名指定ip小结
在fs的目录/etc/下添加文件hosts,然后内容修改如下: 192.168.11.12 qycam.com ping qycam.com 解析为192.168.11.12
- 说说shell脚本中的export 和 source,bash
小弟刚刚接触linux,对linux上的很多东西都比较陌生,所以写一写博客,当做自己工作的总结和技术的积累吧,也是鞭策自己不断努力的去学习. 今天之所以起这个标题,把export,source ,ba ...
- Maps
Maps.uniqueIndex()将列表转换为map //iterator各个元素作为Map.values, key为Function.apply返回值 Maps.uniqueIndex(ps.i ...
- FontMetrics ----- 绘制文本,获取文本高度
Canvas 绘制文本时,使用FontMetrics对象,计算位置的坐标. public static class FontMetrics { /** * The maximum distance a ...