通过蓝牙在 iOS 和 Android 之间传输数据? [英] Transfer data between iOS and Android via Bluetooth?

查看:36
本文介绍了通过蓝牙在 iOS 和 Android 之间传输数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在阅读如何使用 GameKit 通过蓝牙在 iOS 设备之间传输数据.我本身不是在编写游戏,但确实需要在两个设备之间传输少量二进制数据.在两个 iOS 设备之间,这很容易.但是,我想知道是否可以通过相同的机制在 iOS 设备和 Android 设备之间传输数据.

I've been reading up on how to transfer data between iOS devices over Bluetooth using GameKit. I'm not writing a game, per se, but do have a need to transfer a small amount of binary data between two devices. Between two iOS devices, this is easy enough. However, I was wondering if it is possible to transfer data between an iOS device and an Android device via the same mechanism.

有没有人遇到过可以解释如何做到这一点的文档/教程?它甚至在技术上可能吗?或者 Apple 是否设置了某种限制来阻止这种情况发生?

Has anyone come across documentation/tutorial that would explain how to do this? Is it even technically possible? Or has Apple put in some sort of restriction that would prevent this?

我发现的另一个选项是通过蓝牙连接 Bonjour.对于这种类型的操作,这是否是更合适的选择?

The other option I discovered was Bonjour over Bluetooth. Would this be a more suitable option for this type of operation?

推荐答案

这个问题在这个网站上已经被问过很多次了,最终的答案是:不,你不能将 Android 手机连接到 iPhone蓝牙,以及是的,Apple 有阻止这种情况发生的限制.

This question has been asked many times on this site and the definitive answer is: NO, you can't connect an Android phone to an iPhone over Bluetooth, and YES Apple has restrictions that prevent this.

一些可能的替代方案:

  1. 正如您所提到的,通过 WiFi 体验 Bonjour.但是,我找不到有关它的综合教程.
  2. 一些基于互联网的同步服务,例如 Dropbox、Google Drive、Amazon S3.这些通常具有适用于多个平台的库.
  3. 通过套接字直接进行 TCP/IP 通信.(如何在 iOS 中编写小型(套接字)服务器)
  4. 一旦 Android 端的问题得到解决,蓝牙低功耗将成为可能(使用蓝牙 LE 在 iOS 和 Android 之间进行通信)

最酷的替代方案:使用 Bump API.它支持 iOS 和 Android,并且非常容易集成.对于小负载,这可能是最方便的解决方案.

Coolest alternative: use the Bump API. It has iOS and Android support and really easy to integrate. For small payloads this can be the most convenient solution.

无法将任意设备连接到 iPhone 的详细信息.iOS 仅允许在没有 Made For iPhone (MFi) 认证的情况下使用某些蓝牙配置文件(HPF、A2DP、MAP...).您需要实现通信的串行端口配置文件绑定到MFi 会员资格.加入此计划后,您就可以使用 MFi 身份验证模块,该模块必须添加到您的硬件中,并负责向 iPhone 验证设备.Android 手机没有此模块,因此即使可以建立物理连接,身份验证步骤也会失败.iPhone 到 iPhone 的通信是可能的,因为两端都能够验证自己.

Details on why you can't connect an arbitrary device to the iPhone. iOS allows only some bluetooth profiles to be used without the Made For iPhone (MFi) certification (HPF, A2DP, MAP...). The Serial Port Profile that you would require to implement the communication is bound to MFi membership. Membership to this program provides you to the MFi authentication module that has to be added to your hardware and takes care of authenticating the device towards the iPhone. Android phones don't have this module, so even though the physical connection may be possible to build up, the authentication step will fail. iPhone to iPhone communication is possible as both ends are able to authenticate themselves.

这篇关于通过蓝牙在 iOS 和 Android 之间传输数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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