64

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?

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.
    – allprog
    Sep 24, 2013 at 22:54

3 Answers 3

88
+100

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.

10
  • 2
    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? Jan 8, 2014 at 23:45
  • 2
    According to the Bump website their API is discontinued as of Jan 31, 2014.
    – capikaw
    Feb 7, 2014 at 19:18
  • 2
    @user1227928 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=58725
    – allprog
    Jul 10, 2014 at 10:28
  • 8
    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.
    – VH-NZZ
    Feb 3, 2015 at 10:34
  • 1
    @user924 please post a new question according to the official guide. I'm sure you will get answers.
    – allprog
    Apr 12, 2018 at 15:07
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.

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.

2
  • So what APIs do we actually use to transfer data using Bluetooth LE and what's the range? Dec 24, 2017 at 18:43
  • Is it possible to use p2pkit and publish/subscribe both in iOS and Android in the background? Feb 9, 2021 at 8:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.