GameKit peer to peer wifi without wireless router? - ios

Thanks in advance for any thoughts about this. I'm looking for a way to do realtime inter-app communication in iOS via wi-fi (I need about 150 ft range and don't think bluetooth offers this) and wonder about the peer-to-peer connectivity offered by GameKit which, apparently offers both bluetooth and wi-fi connectivity. My question is: must participating devices be members of an available wireless network (via a wireless router) or is this connectivity truly peer-to-peer requiring no router?
I understand Wi-fi Direct is coming and would likely be an option. Just wondering if I can do this utilizing services available in iOS today.
Thanks!
Tim

A router is required for Wi-Fi connectivity. Bluetooth connectivity does not need one.

Related

What to choose for data share in same wifi network: Multipeer, Bonjour, Socket connection

I am working on data share over same wifi two/more iOS devices.I have successfully implemented it using multipeer networking and explored it from videos documents.I am just looking on apple Dev for difference between Bonjour vs Multipeer Networking. Is there some one in group who have worked on both and can share me his experience with what to choose.
My requirement:
Connect two/more iOS device in Same Wifi Network
Automatic Discovering and Connectivity.
Data Size Can be 1 KB to 1 GB.(working on it with MC).
Resume data share when disconnect and connect(looking for it with MC).
Which is more reliable?
What will YOU choose?
I am also looking at GCDAsyncSocket(Don't know i m on right direction).
So please share your experience.
Thanks.
As per documentation says:
The Multipeer Connectivity Framework provides a layer on top of Bonjour that lets you communicate with apps running on nearby devices (over infrastructure Wi-Fi, peer-to-peer Wi-Fi, and either Bluetooth (for iOS) or Ethernet (for OS X) without having to write lots of networking code specific to your app.

Communication over wifi or wirless access points in iOS device

I am looking for making my app compatible with wifi in the same infrastructure. So is there any SDK that can support bi-directional communication without internet, we assume that devices will be placed closed to each other.
Regards,
Aamir
Apple provides the Multipeer Connectivity Framework:
The Multipeer Connectivity framework provides support for discovering
services provided by nearby iOS devices using infrastructure Wi-Fi
networks, peer-to-peer Wi-Fi, and Bluetooth personal area networks and
subsequently communicating with those services by sending
message-based data, streaming data, and resources (such as files).
This SO answer directly addresses your question.

Are Wi-Fi Direct and Wi-Fi P2P the same?

Maybe this is a stupid question but..
Are Wi-Fi Direct and Wi-Fi P2P the same thing?
And I mean, the EXACTLY same thing?
I'm getting really confused with this two.
Wifi Direct is a technology for peer to peer connections and is very different from wifi. Wi-Fi Direct, initially called Wi-Fi P2P, is a Wi-Fi standard enabling devices to easily connect with each other without requiring a wireless access point.It is usable for everything from internet browsing to file transfer
Wifi Direct is not same as wifi . On Jelly Bean and above, when you try to use the WifiP2pManager API, WiFi-Direct is automatically enabled (as long as WiFi is on). Wifi can be switched on by calling:
WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); wifiManager.setWifiEnabled(true);
For ICS refer to this Can I turn on WiFi-Direct from code? on Android API-14 (ICS)
This is the main reason to get confused between the two.

Sharing Data Between iOS devices

I would like to do data sharing(Maybe xml or json file) between 2 iOS devices (iPhone or iPad) and communication would be like "one to many bidirectional" bases at a time.
With some experience and from articles , I have found below ways to do it.
Wi-Fi Direct
AirDrop
Bluetooth(By creating Master and Slaves)
Bonjour SDK.
Bump API(Which is already closed from january 2014)
Could anybody please suggest the best way to fulfill my requirement, which is a good way to do it?
Since IOS 7 Multipeer Connectivity could also be quite interesting.
The Multipeer Connectivity framework provides support for discovering services provided by nearby iOS devices using infrastructure Wi-Fi networks, peer-to-peer Wi-Fi, and Bluetooth personal area networks and subsequently communicating with those services by sending message-based data, streaming data, and resources (such as files).
Here is a nice tutorial about implementing a file sharing system using multipeer connectivity:
http://www.appcoda.com/intro-ios-multipeer-connectivity-programming/
Wi-Fi
Connecting to your Personal Hotspot via Wi-Fi is the default option provided by Apple, since you have to specifically accept if you also want to enable the Bluetooth connection. A Wi-Fi connection provides:
Pros
High throughput: Throughput via Wi-Fi Personal Hotspot can be of around 30 Mbps between two devices and even more.
Faster: Connecting via Wi-Fi tends to be quite faster than connecting via Bluetooth.
Cons
Might need you to reconnect every time: Wi-Fi tends to be unstable and to turn itself off every time you put your iPhone to sleep. This means that you have to take out your iPhone and re-enable the Personal Hotspot if you want to connect.
Time limit: Perhaps the biggest drawback of using a Wi-Fi Personal Hotspot with your iPhone is that in order to minimize power consumption, your iPhone only gives you a short while (90 seconds reportedly) to connect a device to it after you enable Wi-Fi Personal Hotspot. If you take longer than that, you are forced to enable the option again.
More power consumption: The Wi-Fi Personal Hotspot consumes more power than its Bluetooth counterpart, which is also part of the reason it only gives you a short while to connect a device.
A bit more complex: The iPhone’s Wi-Fi Personal Hotspot requires you to enter a password and to configure your own security options.
Bluetooth
Contrary to the Wi-Fi connection, using your Personal Hotspot via Bluetooth offers some key advantages and one huge drawback:
Pros
No time limit: Once you enable Bluetooth Personal Hotspot, there is no time limit for you to connect your device to your iPhone.
Automatic pairing: Bluetooth remains dormant and ready to connect to your devices the moment you wake them up. Additionally, Bluetooth is more power-efficient than Wi-Fi.
Security handled automatically: The security level of a Bluetooth Personal Hotspot is equivalent to Wi-Fi’s WPA2, and it is all handled transparently from the moment you connect to it.
Cons
Very limited throughput: Without a doubt the biggest drawback of using a Bluetooth Personal Hotspot is its limited throughput, which can be of just 3 Mbps at the most, making it 10 times less than what your Wi-Fi Personal Hotspot can offer.

iOS: how do I know if I'm still connected to oprators's cellular network

My iPhone is connected to cellular network and my own WiFi. If I go to the basement I'm still connected to wifi, by cellular connection goes down. How can I know that the cellular connection is active or not?
You need "Reachability". Apple have provided it since the early days of the SDK, there is a link to a version by Tony Miller in this answer and it is also part of the highly recommended AFNetworking (another relevant answer). It will tell you whether you have any connection and what kind it is.

Resources