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.
-
Why you wan't to skip java.net.Socket? – patrick Feb 16 '17 at 06:36
-
thanks for comment but i'm not involved any severer please give me any other suggestion – Riaz Yousaf Feb 16 '17 at 06:42
-
What do you mean with server? a dedicated server on the internet or a [socket server](http://stackoverflow.com/questions/7626405/how-to-write-a-small-socket-server-in-ios) on the phone? – patrick Feb 16 '17 at 06:44
-
And what kind of data you would like to exchange? – patrick Feb 16 '17 at 06:44
-
actually i make ios remote app for android tv app and i exchange small data in few meter distance – Riaz Yousaf Feb 16 '17 at 07:11
-
In this case Bluetooth LE will be your friend, publish a service on the tv and subscribe from the ios app. – patrick Feb 16 '17 at 07:20
-
thanks for suggestion i try it. – Riaz Yousaf Feb 16 '17 at 07:26
3 Answers
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
-
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
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.

- 826
- 1
- 9
- 28
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.

- 6,902
- 7
- 42
- 90