0

I have been looking for a solution for establishing Communication between Android Phone and IOS phone.I think ios's bluetooth is not support bluetooth communication.so i chose wifi.is there any way to communicatiton without java.net.ServerSocket/java.net.Socket.

3 Answers3

1

You can't connect the devices over to Bluetooth connection Protokoll: Transfer data between iOS and Android via Bluetooth?

But if you're not needing a two way socket connection, you're maybe able to do it over Bluetooth LE. You need to create a profile or reuse one and subscribe on the other phone to this profile and vice versa.

A Sample for Bluetooth LE: Communicating between iOS and Android with Bluetooth LE

Community
  • 1
  • 1
patrick
  • 826
  • 1
  • 9
  • 28
  • Thanks for Answer i also use Bluetooth LE but the connection always lasts exactly 10 seconds and then disconnects. – Riaz Yousaf Feb 16 '17 at 07:05
  • With Bluetooth LE you can't really connect, you have to subscribe to a service. After 10 seconds the device disconnect to save battery, but the device will hear to publish statements on the subscribed services. If there is something published it will be passed to the app. – patrick Feb 16 '17 at 07:08
0

An Other solution would be to use Bonjour over WiFi: Implementation on Android: https://andriydruk.com/post/mdnsresponder/

Then you have to handle any kind of WiFi connection between the two phones.

patrick
  • 826
  • 1
  • 9
  • 28
0

I would strongly suggest you use ZeroMQ. They have libraries in almost every language for WiFi communication, so you should be able to get it working on both devices. I have it working from Java in Android to Python on a Windows PC, so getting Ios working should be quite easy as well.

bremen_matt
  • 6,902
  • 7
  • 42
  • 90