I would like to create an application where near phones/devices can send data between each other.
it should look like that all devices except one turn on some listening function. One device create game and add each of devices from list to game.
I know how to accomplish this task with use of intermediary server. But I would like to achieve this in a different way without server. For example I can create app which find near ibeacons and displays them in a list, and get data from them. Is it possible to make to way communication by bluetooth between phones with bluetooth?
Maybe other technologies? I do not want to use NFC, because range is to short.
Another limitation is that, this solution should be an cordova/phonegap plugin?
Edit:
I need to communicate between users devices. For example I want to make app where two users standing near each other chat together. Messages should be send between phones, without server.
It sounds like iBeacons is the perfect solution for what you're attempting to achieve. It doesn't require NFC or a server–only devices that have Bluetooth 4.0 LE (Low Energy).
If you're unhappy with iBeacons, I recommend the Multipeer Connectivity framework that also became available in iOS7:
https://developer.apple.com/library/ios/documentation/MultipeerConnectivity/Reference/MultipeerConnectivityFramework/
Here's a good tutorial on AppCoda:
http://www.appcoda.com/intro-multipeer-connectivity-framework-ios-programming/
Another benefit to using the Multipeer Connectivity framework as opposed to iBeacons, is that it doesn't require Bluetooth 4.0 LE, which isn't available on iPad 2 and iPhone 4 devices.
Related
Background
I would like to achieve a peer-to-peer connection to transmit data between two mobile devices. The amount of data to be transmitted would be around 70-200 bytes, so it is quite small. This transmission also won't be some stream-like continuous flow. It would be a one-time thing to get the acknowledgement of the devices.
TL;DR: I want to exchange data between 2 mobile phones which would be using the same app.
Requirements
Has to work offline
Has to work between IOS & Android
So Far
I have analyzed a few possible ways to achieve that and I am quite confused about what to pick.
NFC: I want to simultaneously send data for both phones and NFC does not work as a tag in the IOS. If there is a workaround for that let me know.
NFC + BLE: This approach utilizes the NFC to pair devices to use Bluetooth then the data transfer is conducted on BLE.
So, I'm humbly asking a direction about getting my head around those concepts to solve my problem. If you have another technology that might help me, please specify it. Also, I'm making the development with React Native.
Out of curiosity... has anyone ever been able to integrate AirDrop functionality into an Android app?
I really don't care about receiving any information on the Android side, but am hoping I can send information to the iOS side from Android. I'm hoping to find someone with a more in-depth understanding of how it works and if it is physically possible. Also, any direction on whether Apple has proprietary use over the protocol (or if it is just the name and branding) would be awesome!
Trying to build a cross-platform app and getting pretty close, but this would just extremely convenient if it works out :)
Currently, it is not possible as AirDrop uses Bluetooth to create a peer-to-peer Wi-Fi network between the devices. Each device creates a firewall around the connection and files are sent encrypted, which actually makes it safer than transferring via email. AirDrop will automatically detect nearby supported devices, and the devices only need to be close enough to establish a good Wi-Fi connection, making it possible to share files across several rooms.
Some Android devices use a combination of Near Field Communications (NFC) and Bluetooth to share files. But both Bluetooth and NFC are relatively slow compared Wi-Fi, which makes sharing larger files using AirDrop much faster and more convenient.
Regarding protocol, I don't think Apple has made it public and as far as I know Apple they must have patented it. Since AirDrop uses Bluetooth as well, and Android and iPhone Bluetooth are not compatible. Hence, due to all these reasons, we did not see any Android app that can send data via AirDrop.
I am trying to automate my dorm room for the upcoming semester. I have a bunch of arduino uno's lying around and I want to use them to control different appliances in the room, which I want to do via an IPhone app. I found a few tutorials online about using an HC-05 but none explicitly say if I need more than one if I want to control different devices from the same app or really anything about controlling multiple devices with one app.
TL;DR I want to control a bunch of devices from my phone, before I go out and buy the wrong parts what do I need and how do I connect multiple devices to one bluetooth device?
You can not use the HC05 module with an iPhone. Apple pushes BLE (Bluetooth Low Energy). If you were using an android app, it would work perfectly. My best advice would be to get one of these. They work well with arduino. That one would connect to one arduino, and that arduino could be connected to multiple relays to control lights, fans, etc.
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?
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:
Bonjour over WiFi, as you mentioned. However, I couldn't find a comprehensive tutorial for it.
Some internet based sync service, like Dropbox, Google Drive, Amazon S3. These usually have libraries for several platforms.
Direct TCP/IP communication over sockets. (How to write a small (socket) server in iOS)
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.
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.
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.
I will write an android program. for simplicity, it will need a connection similar to multiplayer games. I will need to connect two or more devices in a way that they will send and get short data ocassionally ie. once in 20 seconds. Which class should I use, or what type of protocol should I implement?
Well, there are a number of methods to send data. A bit of this depends on the device, and what specs they have, but in general, here's the methods, along with the pros and cons.
Bluetooth- This will work within a room. Most cell phones have Bluetooth as well. It requires the devices sync up externally, and thus might be a bit tricky, but it is doable.
Wifi/internet- Most devices have an internet connection. The devices could communicate with a server, who would share data between devices, or directly. Android 4.0 allows for direct communication via WiFi, but in general, I would only recommend this for 4.0 devices.
Near Field Communication- New to Android 4.0 (Very few phones have 4.0). This will only work for very short distances (