Android的蓝牙连接到嵌入式设备 [英] android bluetooth connection to embedded device

查看:416
本文介绍了Android的蓝牙连接到嵌入式设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建的应用程序中,我不得不数据通过嵌入式设备发送到手机上。

i am creating app in which i had to send data to phone via embedded device.

是否有可能通过嵌入式设备发送文件到Android手机与蓝牙?

is it possible to send file via embedded device to android phone with bluetooth?

我没有找到任何的例子吧,我想我需要另一种嵌入式设备,如加密狗实现OBEX协议。

i dont find any of example of it and i think i need another embedded device like dongle for implementing obex protocol.

如果任何人都做到了B4请帮助我。

if anyone have done it b4 pls help me.

推荐答案

您需要阅读在正在提交的设备中的文件的字节数。样品code连接的机器人到一个单独的设备可以在此<一个被发现href="http://stackoverflow.com/questions/2660968/how-to-$p$pvent-android-bluetooth-rfcomm-connection-from-dying-immediately-after">SO帖子。还有一个API的健壮文档以及一个特定< A HREF =htt​​p://developer.android.com/resources/samples/BluetoothChat/index.html相对=nofollow>示例应用程序。要知道,很多人都在使用示例应用程序,试图android的连接到单独的设备时发现的问题。这个问题在此 SO后(见接受的答案),但本质上是连接问题是通过调用 listenUsingRfcommWithServiceRecord 引起的。

You need to read in the bytes of the file that is being submitted by your device. Sample code that connects the android to a separate device can be found in this SO post. There is also a robust documentation of the API as well as a specific sample application. Be aware that many people are finding issues when using the sample application to try and connect the android to a separate device. The issue is explained in this SO post (see the accepted answer), but essentially the connectivity problem is caused by calling listenUsingRfcommWithServiceRecord.

我自己碰到的问题有蓝牙,但使用上述资源已经能够非常成功地与一个嵌入式设备连接我的机器人。希望此聚集的信息将是你有帮助。

I myself ran into problems with Bluetooth, but using the above resources have been able to quite successfully connect my android with an embedded device. Hopefully this aggregate of information will be of use to you.

这篇关于Android的蓝牙连接到嵌入式设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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