Android 模拟器上的蓝牙支持 [英] Bluetooth support on Android Emulator

查看:471
本文介绍了Android 模拟器上的蓝牙支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道制作模拟器的开发团队是否有一些信息可以让蓝牙在 Android 模拟器中工作,指出一些关于它的链接,如果他们有发布日期或者他们是否会让蓝牙在 Android 模拟器中工作未来.

I want to know if the developer team which made the emulator have some information to make bluetooth work in the Android emulator, indicate some links about it, if they have some date for release or if they'll make it works in the future.

推荐答案

据我所知,模拟器不支持蓝牙.我将不得不在某些课程中教授 android 和蓝牙.学生将需要在 android 模拟器中编写代码并进行测试(猜测).

as far as I know there is no support in the emulator for bluetooth. And I will have to teach android and bluetooth in some classes. And the students will need to code stuff and test (guess it) in the android emulator.

所以我想出了一个基于 tcp 的安卓蓝牙 API 的基本重新实现.您可以在 这里在 github 上找到它.

So I came up with a bare-bone reimplementation of the android bluetooth API on top of tcp. You can find it on here on github.

基本上,你在你的机器上运行一个 tcp-server,模拟器将通过它连接.而不是使用包android.bluetooth中的类,你只需要使用包dk.itu.android.bluetooth中的类(和其他2个小修改).

Basically, you run a tcp-server on your machine, and the emulators will connect through it. Instead of using the classes in the package android.bluetooth, you just need to use the classes in the package dk.itu.android.bluetooth (and other 2 little modifies).

至于现在它支持:

  • 打开/关闭收音机"
  • 发现设备(仅限其他安卓模拟器)
  • 创建蓝牙服务
  • 连接到蓝牙服务

这并不多,但在我们从 android 人员那里得到更多之前,我想没有其他东西了.

It's not much, but until we got some more from the android guys, I guess there is nothing else around.

希望有用,加油!

这篇关于Android 模拟器上的蓝牙支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆