如何在 android 和 ios 之间建立通信

how to establish communication between android and ios

我一直在寻找在 Android Phone 和 IOS 之间建立通信的解决方案 phone.I 认为 ios 的蓝牙不支持蓝牙communication.so 我选择了 wifi.is 没有 java.net.ServerSocket/java.net.Socket.

有任何沟通方式

您无法将设备连接到蓝牙连接 Protokoll: Transfer data between iOS and Android via Bluetooth?

但是如果您不需要双向套接字连接,您也许可以在 Bluetooth LE. You need to create a profile or reuse one and subscribe on the other phone to this profile 上完成,反之亦然。

低功耗蓝牙样本:Communicating between iOS and Android with Bluetooth LE

另一种解决方案是通过 WiFi 使用 Bonjour: Android 上的实施:https://andriydruk.com/post/mdnsresponder/

然后你必须处理两部手机之间的任何类型的 WiFi 连接。

我强烈建议您使用 ZeroMQ。他们拥有几乎所有用于 WiFi 通信的语言的库,因此您应该能够在两种设备上使用它。我在 Android 的 Java 到 Windows PC 上的 Python 工作,所以让 Ios 工作也应该很容易。