Transfer data between iOS and Android via Bluetooth?
Asked Answered
C

3

65

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.

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?

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

Cirri answered 19/9, 2013 at 1:1 Comment(1)
I added the Bump API to my answer as it looks to be a very appealing way to implement data transfer for small payloads.Renunciation
R
89

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.

Some possible alternatives:

  1. Bonjour over WiFi, as you mentioned. However, I couldn't find a comprehensive tutorial for it.
  2. Some internet based sync service, like Dropbox, Google Drive, Amazon S3. These usually have libraries for several platforms.
  3. Direct TCP/IP communication over sockets. (How to write a small (socket) server in iOS)
  4. Bluetooth Low Energy will be possible once the issues on the Android side are solved (Communicating between iOS and Android with Bluetooth LE)

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.

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.

Renunciation answered 24/9, 2013 at 14:25 Comment(10)
Just on Bump API, I found that it does not use bluetooth! It's sending data with NFC technology which is just for a distance of a few centimeters. Or am I missing something here?Byrann
According to the Bump website their API is discontinued as of Jan 31, 2014.Liselisetta
Can this problem now doable with Android L and iOS 8 as both can act as central and peripheral ?Alegar
@Alegar BLE does not require MFi. But Android and iOS still cannot connect due to a bug in android: code.google.com/p/android/issues/detail?id=58725Renunciation
I thought the NFC on iOS was restricted. I would prefer this to bluetooth but I thought that it was impossible on ios.Ermeena
This MFi for Bluetooth is ludicrous. Imagine being restricted to certain WIFI airports only. I don't see why Apple keeps on putting useless locks on industry standards. These political decisions are so annoying.Shaver
how can I send data (some bytes) from iPhone to Windows or Ubuntu over Cable or Bluetooth?Heterotopia
@Heterotopia please post a new question according to the official guide. I'm sure you will get answers.Renunciation
@Hi all , What is the current status of iphone to android bluetooth connection for file (text . photo) transfer ? Is it possible or restricted still ?Misestimate
@JamshedAlam I do not know about any improvements but feel free to update the answer to actualize it.Renunciation
E
3

Maybe a bit delayed, but technologies have evolved since so there is certainly new info around which draws fresh light on the matter...

As iOS has yet to open up an API for WiFi Direct and Multipeer Connectivity is iOS only, I believe the best way to approach this is to use BLE, which is supported by both platforms (some better than others).

On iOS a device can act both as a BLE Central and BLE Peripheral at the same time, on Android the situation is more complex as not all devices support the BLE Peripheral state. Also the Android BLE stack is very unstable (to date).

If your use case is feature driven, I would suggest to look at Frameworks and Libraries that can achieve cross platform communication for you, without you needing to build it up from scratch.

For example: http://p2pkit.io or google nearby

Disclaimer: I work for Uepaa, developing p2pkit.io for Android and iOS.

Edyth answered 3/5, 2016 at 16:9 Comment(0)
T
2

You could use p2pkit, or the free solution it was based on: https://github.com/GitGarage. Doesn't work very well, and its a fixer-upper for sure, but its, well, free. Works for small amounts of data transfer right now.

Treasurer answered 25/4, 2017 at 6:42 Comment(2)
So what APIs do we actually use to transfer data using Bluetooth LE and what's the range?Abundance
Is it possible to use p2pkit and publish/subscribe both in iOS and Android in the background?Pontiff

© 2022 - 2024 — McMap. All rights reserved.