两个Android设备之间基于RFCOMM的蓝牙通信 [英] RFCOMM based bluetooth communication between two android devices

查看:76
本文介绍了两个Android设备之间基于RFCOMM的蓝牙通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于某些需求分析,我想测试两个android设备之间基于RFCOMM的蓝牙通信.

For some requirement analysis I want to test a RFCOMM based bluetooth communication between two android devices.

我需要从Android设备1发送一些数据到1 MB,Android设备2应该接收它并显示/保存数据.我需要使用Bluetooth SPP(RFCOMM)配置文件执行此操作.

I need to send some 1 MB of data to from Android device 1 and Android device 2 should receive it and display/save the data. I need to do this using Bluetooth SPP (RFCOMM) profile .

任何人都可以建议一些可用的应用程序/代码来做到这一点吗?

Can any one suggest some available app/code to do this?

推荐答案

在适用于Android开发人员的蓝牙文档中.有一个蓝牙聊天应用程序示例,该示例将包含一个促进两个设备之间的通信以及服务连接的活动.这将是您要做的最好的例子.这是教程的链接,您还可以在下面找到到BluetoothChat应用程序的链接:

Under the bluetooth documentation for Android Developers. There is the Bluetooth Chat application example which will contain an activity for facilitating the communication between two devices, as well as the service connection. This will be your best example for what you are looking to do. Here is the link to the Tutorial, you will also find a link to the BluetoothChat application under here:

http://developer.android.com/guide/topics/connectivity/bluetooth.html

要查看BluetoothChat应用程序,您首先需要Android SDK,然后才能找到源.

To see the BluetoothChat application you will first need the Android SDKs, and then you will be able to find the source.

通常,请先做一些研究,因为这是另一个同类问题,但有一点点细节,它表明用户首先做了一次很好的尝试.

Generally, do some research first, as here is another question of the same sort that has a little more detail, and shows the user made a good attempt first.

Android的蓝牙示例

在遵循BluetoothChat应用程序或Android Docs上的书面教程之后,如果您遇到蓝牙错误以及代码的其他问题.堆栈溢出绝对是获得对您的问题的高质量答案的方法!

After following the BluetoothChat application, or the written tutorial on the Android Docs, if you run into bluetooth errors, and other problems with your code. Stack Overflow is definitely the way to go for receiving quality answers to your troubles!

这篇关于两个Android设备之间基于RFCOMM的蓝牙通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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