通过蓝牙接收图像
我可以通过蓝牙传输数据(字符串),但我无法进行图像传输。 我想通过蓝牙从 PC 应用程序接收图像,存储它们,并在需要时在我的 Android 应用程序中获取它们。
文件对于这个目的有用吗? 任何帮助表示赞赏。 任何参考代码(如果有)请分享。
I am able to transfer data (a string) over Bluetooth but I'm stuck with image transfer.
I want to receive images from a PC app via Bluetooth, store them, and fetch them in my Android app when needed.
Is files useful for the purpose?
Any help appreciated.
Any reference code if available please do share.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您与对等方连接,则可以获得BluetoothSocket 对象。它给你一个OutputStream,你可以写任何你想要的东西。从 android 3.0 开始,您可以构建自己的蓝牙配置文件或使用预定义的。不幸的是它不支持任何图像推送(BIP,OPP等),所以你必须实现它(可能你在PC端使用的API有它)。您始终可以构建原始二进制协议。
If you are connected with a peer, you can obtain BluetoothSocket object. It gives you a OutputStream and you can write whatever you want. Since android 3.0 you can build own bluetooth profile or use predefined. Unfortunately it doesn't support any image pushes (BIP, OPP, etc.), so you have to implement it ( probbaly API which you use on PC side has it ). You can always build raw binary protocol.