免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2239 | 回复: 0
打印 上一主题 下一主题

Android手机Nexus One连接Apple Bluetooth Keyboard [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-09-04 23:07 |只看该作者 |倒序浏览
Android手机Nexus One连接Apple Bluetooth Keyboard
Posted on August 20, 2010 by henry
首先所有带蓝牙的android手机理论上都是可以连接蓝牙键盘鼠标的(Human Interface Device),不幸地是官方的蓝牙profile中默认不包括HID profile。所以只有采用第三方的ROM如Cyanogen(CM6版本以上)或在官方的rom上搭配bluez utility来实现蓝牙键鼠的连接。
这里我们仅讨论第二种在官方ROM上添加工具的方案。手机必须取得root权限,或者是ADP (Android Dev Phone),并且需要安装busybox。
1. 先下载需要的工具。
$ wget http://androidobex.googlecode.com/files/hciconfig
$ wget http://androidobex.googlecode.com/files/hcitool
$ wget http://androidobex.googlecode.com/files/hidd
2. 提升到root权限,并且将/system挂载成可读写,默认为read-only
$ su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# chmod 777 /system/xbin
3. 从本地复制第一步下载的文件到手机
$ adb push hidd /system/xbin
$ adb push hcitool /system/xbin
$ adb push hciconfig /system/xbin
4. 如果你的手机不是ADP的话,可能无法直接从本地电脑复制文件到手机。这样你可以先用usb线连接手机,把以上三个文件复制到sdcard根目录上,然后执行。
# cp /sdcard/hidd /system/xbin/
# cp /sdcard/hcitool /system/xbin/
# cp /sdcard/hciconfig /system/xbin/
5. 打开手机蓝牙,在Settings -> Wireless & network settings -> Bluetooth settings中找到键盘并且配对。pin code可以填写0000,配对成功后会发现该设备显示为’paried but not connected’,这是因为缺少HID profile。
6. 现在要用到之前拷入手机的三个文件。实际情况中设备的Mac地址会与下面的例子有所不同,根据实际情况输入。
# hciconfig
hci0: Type: UART
BD Address: 00:22:A5:B8:AD:65 ACL MTU: 1021:4 SCO MTU: 180:4
UP RUNNING PSCAN
RX bytes:8672 acl:98 sco:0 events:285 errors:0
TX bytes:3336 acl:102 sco:0 commands:89 errors:0
# hcitool dev
Devices:
hci0 00:22:A5:B8:AD:65
# hcitool scan
Scanning …
00:1D:4F:A7:9A:49 Apple Wireless Keyboard
# hidd –connect 00:1D:4F:A7:9A:49
# hcitool con
Connections:
< ACL 00:1D:4F:A7:9A:49 handle 1 state 1 lm MASTER
9. 至此,Apple Bluetooth Keyboard连接成功。打开任意程序,蓝牙键盘敲击的键将出现在输入栏。经过测试,谷歌中文法也可以正常使用并且可以用数字键选择候选字。
10. 剩下的问题就是苹果的键盘的多功能键(调节音量,屏幕亮度)暂时还不能在手机里使用,有待进一步研究如何修改这几个键位。



转载:http://hi.baidu.com/fanrifei/blo ... f25fe22e73b3dc.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP