简体   繁体   English

android通过蓝牙发送文件而不配对

[英]android send files over bluetooth without pairing

There's a way I can send a file to an android device (wich already has my app installed) without paring or the app making the pairing in the background? 有一种方法可以将文件发送到android设备(目前已经安装了我的应用),而无需进行配对或该应用在后台进行配对? (Without user intervention) (无需用户干预)

In my country just few people have data plans in their phones, so I want to create some kind of "server" using a raspberry and a bluetooth dongle so everytime an user with my app it's inside my store, I can show them notifications (with images and text) using the bluetooth connection insted of their cellphone data. 在我国,只有少数几个人的手机中有数据计划,因此我想使用树莓派和蓝牙软件狗创建某种“服务器”,以便每次有我的应用程序的用户进入我的商店时,我都可以向他们显示通知(图片和文字),并使用手机数据中的蓝牙连接。 (To detect they are in my store I can use geofences or regular beacons) (要检测它们在我的商店中,我可以使用地理围栏或常规信标)

BLE is not intended to send files with huge size, since it can maximally send 20 byte chunks of data at a time. BLE并非旨在发送大文件,因为它一次最多可以发送20个字节的数据块。 I'll definately go for the standard Bluetooth protocol if you have a file consisting of a huge size. 如果您的文件大小很大,我一定会选择标准的蓝牙协议。

The pairing notification depends on how the app has been developed. 配对通知取决于应用程序的开发方式。 If you know the device address (MAC address as unique ID) of the remote device beforehand, then you can make a simple "if" statement that checks whether the device address of each discovered device equals the one you have defined. 如果您事先知道远程设备的设备地址(MAC地址为唯一ID),则可以执行简单的“ if”语句,以检查每个发现的设备的设备地址是否等于您定义的地址。 If yes, then you can establish a connection. 如果是,则可以建立连接。 As a result, the app will automatically establish a connection with the desired device. 结果,该应用程序将自动与所需设备建立连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM