at the moment I'm planning to build an cross-plattform app (iOS/android) that streams music from one device to others without internet. Now I'm considering which network technology is best for this use case. By the way I'm sorry I didn't say hello to you, it disappears all the time.
Existing wifi network:
I don't wanna use this because I want my app to work everywhere.
Wifi-Direct:
Not supported by iOS (tell me if I'm wrong).
Bluetooth:
Here I've found kind of conflicting information.
Bluetooth 2.1 is supported by both iOS and android but iOS has its own protocols and doesn't support the common ones.
Bluetooth Low Energy provides a data rate that is too slow for high quality music streaming (1Mbit) and is supported by iOS but on the android side version 4.3 is required which suspends about half of all users.
What I'm not sure about is the "normal" (not LE) usage of Bluetooth 4.0. Does anyone have experience/information about this?
Creating a wifi hotspot:
This was my first idea and probably it's the best. But there are several issue:
Some carriers do not allow hotspots
It's not possible to create a hotspot without cell reception on the iPhone and some (I don't know which exactly) android devices.
It's not possible to create a hotspot without cellular data activated on an iPhone; I don't know what about android devices (Nexus 4: no problem, SGS3 mini: cellular data can be switched off after creating the hotspot)
-> that's a problem for those who don't have an internet unlimited plan or for those who don't want to share their internet connection (as this dissipates the high speed volume) but see the next point for that.
In order that everyone can use his own cellular data connection the wifi settings can be manually edited on iOS (remove router, DNS and search domains entries). Is there a way to do so on android as well? Is there way to automize this process?
https://apple.stackexchange.com/questions/173894/can-i-connect-to-wifi-but-still-use-cellular
Is there any way to create a wifi network programmatically (not just enable the normal wifi hotspot)?
SDKs/Frameworks like Open Garden or Alljyon looked promising at the beginning but:
Firechat (which is made by the Open Garden team) promises that iOS and android devices can chat locally without existing network but actually it didn't work for me with an iPhone 6 and SGS3 mini. However they don't want to publish their SDK. The only information I got is that it works over wifi-direct and bluetooth. If anyone has an idea how this could work, please tell me.
Alljoyn does not provide direct communications between iOS and android without an existing network. (Tell me if I'm wrong)
API's:
iOS multipeer connectivity does not support android
I hope anyone can help me.
Regards Nils
If you are talking about a TVBOX device with Android, you will need the ethernet cable connected in order to create a hotspot.
Another option that I have done is:
Create a service that runs on iPhone with an interfaz, do whatever you want on that interfaz, then send what ever you need to a webservice, then in Android, just pull that info from another App as a service, or just store it in an internal sqlite.
Good luck
Related
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 currently trying to develop a mobile application for both iOS and Android. It basically will be a game buzzer app, determining which of the players is granted a right to answer a specific questions.
The problem is that I struggle to determine which technology / framework I should use for that. Now, some details:
In this app there will be a "base" - it is the phone that gives
"start" signal for all the other players. Each buzzer pressed before this signal corresponds to a false start. Eventually, information
about which player is granted a right to answer or is penalized due
to false start should be displayed on the base device.
App is done for people who have no access to the internet. All the
communication should exists given ONLY mobile phones with no data
plan.
Max number of communicating devices is 9 (1 base and 8 players)
I investigated a lot of resources and this is what I discovered:
Regular WLAN with TCP sockets and etc won't help, since it assumes that all devices are connected to same wireless access point - it violates my requirements.
Regular bluetooth won't help either. This would work across a specific platform, but making Android talk to iOS is impossible.
Situation with Wi-Fi direct is same as with regular bluetooth. Both platforms support this, but Apple's MultipeerConnectivity framework works only with iOS devices.
Now the last option I am left with is BLE. Both platforms support this and are able to intercommunicate (acting both as central or peripheral devices). However, due to my requirements for an app, I assume that base device should act as peripheral, and according to (sometimes conflicting) articles on Internet, one can't connect several central devices to single peripheral.
Now, my questions:
I still assume I might have done some mistakes in the bullet points above, so please, correct me if I am somewhere wrong.
Now when I am left only with BLE option, are there any possible solutions to the above issue? Maybe it is possible to use all devices as centrals (?). I recently saw this example, where everything works cool. Sorry in advance, if I said something stupid.
Of course, there is a counterexample - FireChat, which employs OpenGarden's MeshKit. But the framework is not available. I tried communicating OpenGarden people, but no response. Does anyone know if it is planned to go opensource soon, or maybe there exists any analog of this?
Try the Hype SDK by Hype Labs. It's a multi-transport, multi-hop mesh SDK. It supports interoperable Bluetooth Low Energy (and other transports as well). The SDK is currently in private beta but will be made available upon approval of the subscription.
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'm working on a cross-platform multiplayer game on android and ios.
I need to create a direct network connection between devices without a main server to be able to play without any internet access (e.g. in the metro).
I already tried this kind of game named "Skies of Glory" where the link between players were performed directly without internet access. Such as computer games, client players can see and connect on a game server created by one of players.
I was unable to find a "free" game framework able to provide this kind of network feature so I try to find out a standardized way to see host servers and etablish a communication without any user prompt thru a wireless connectivity (wifi or bluetooth). iOS and Android are separate worlds but most of network standards are supported by both platforms.
So how do it ?
I already excluded solutions:
Android's WIFI direct: not compatible with iOS and available on 4.x so it's too limited.
OSI's high level protocols because it suppose to be in the same managed network (so impossible in metro)
My leads
Turn one of the devices as a router but without user action.
Piconet technology if it's available on both OS.
If anybody have another idea ....
Thank you for your help
On iOS you could try using Bonjour http://en.wikipedia.org/wiki/Bonjour_(software) https://developer.apple.com/technologies/ios/networking.html but there is a reasonable amount of your own programming that would be needed to build what you need.
On Android you might be able to use zeroconf http://en.wikipedia.org/wiki/Zero_configuration_networking if you can find a suitable existing port or port it yourself using the NDK.
I'm trying to make an app on an Android device that will control an application on an iPad or Android tablet. (I'm testing with an Samsung Galaxy S2 and an iPad 2).
The application is pretty simple for now. When one selects a colour on the Android mobile, that colour displays on the tablet device.
The question is, how to connect the two devices. Just now I've verified that I can pair the two devices using Bluetooth. Also, the Samsung has a "Kies" Wifi Direct feature (which I don't understand fully), that allows the iPad to connect to the Galaxy as a wifi hotspot.
The connections are there, but I don't know if either protocol can be used to actually get the apps to talk to each other to get the control I'm looking for.
Should I be using Bluetooth, Wifi, or something else?
And in whichever case, how?
My opinion is that you should not stick so much around the physical medium used for connectivity either is WiFi or Bluetooth. You should abstract this aspect, in both cases you will be using sockets (I'm speaking about Android), if it's Bluetooth you will be using Bluetooth Sockets, if it's WiFi: TCP sockets. You could have a intermediate layer that abstracts the type of connection and through a factory to use either Bluetooth or TCP.
Bluetooth - http://developer.android.com/guide/topics/wireless/bluetooth.html
For WiFi you should study if P2P would help.
You will need two applications:
- one on the tablet - the server which listens for commands from the client (change color, do this or this)
- second on the smartphone - the client which sends commands.
I've built a few apps that do exactly that between iPhone and iPad. But the principle is the same. I used Bonjour networking. It's just a fancy name for ZeroConfig networking between devices. It's written originally by Apple but it's open source so there should be Android support out there for it too. Really simple and easy to work with.
If you already have a working connection then you already have the first half of your answer, that said you should really consider implementing a solution that uses a variety of connection types, WIFI, Bluetooth, etc.. The question I think you are really asking is how to pass data and messages between the apps once you have the connection.
There are a lot of ways to accomplish this. You could implement your own lightweight message passing system. If you haven't done this before it is more complicated than it originally seems, especially as you would be required to implement the system for each OS you end up using.
Should I be using Bluetooth, Wifi, or something else?
It depends on what situations you want your program to work in.
Bluetooth can provide a direct connection between your devices. A potential issue with bluetooth is that it has a limited range. If you're devices need to be far away from each other, you may want to go with wifi. Otherwise, bluetooth could work great.
If both devices are connected to the internet, you can make them talk to each other through there. The advantage of this approach is that it doesn't matter how far apart your devices are as long as they're both online. A disadvantage is that you'll have to figure out how to find the tablet's ip address before you can talk to it. This is actually a HUGE disadvantage because it can be quite problematic if both of your devices are not on the same wifi. You could have the user type in the destination ip address, but you'll have problems getting it to work if the user is behind a router (which will almost always be the case). The point is, it gets hairy.
If both of your devices are on the same wifi, you can use ZeroConf AKA bonjour (like Dancreek said) to figure out what ip address you need to send info to. I've previously used a library called jmdns (easy to find with google) to implement zero configuration networking. It's good because the user doesn't have to worry about ip addresses... it's intuitive for the user.
And in whichever case, how?
Networking is a pretty big topic, so I can't expand on this question to much. Short answer is, it depends on what method you choose. Search for some tutorials and start by getting one of your devices to send something as simple as an int to the other.