iPhone: connecting to multiple networks - iphone

I'm currently working on a project that requires the iPhone to connect to another device using an Ad-Hoc network (WiFi). Simultaneously, I require a connection to the internet in order to upload data to a server also using WiFi.
My question is: is the iPhone capable of connecting to multiple networks?
If not, is it possible (and viable) to switch between networks assuming the data rate is low? For example, iPhone receives data via Ad-Hoc, disconnects, connects to other WiFi network, established connection with server, sends data, disconnects from network, reconnects to Ad-Hoc network etc?

If the data rate is low and you are talking to another iOS device, check out GameKit.
This is Bluetooth, though.
I have not seen a way to connect to multiple wi-fi networks simultaneously.

Related

iPhone app sharing data over both Wifi networks

I need to make an iPhone application which connects to a first Wifi network, receives some files from a specific device and then sends these files to a computer being connected on another Wifi network.
I see two possible approaches :
1. to send the files to the computer, my app disconnects from the first Wifi network and connects again to the second network
2. my iPhone app is able to connect itself to two different Wifi networks.
I believe the second solution above is not possible on iOS and the first one needs to use private APIs.
Do you see for other solutions for me to receive data from a device connected to a Wifi network and then send data to another device connected to another Wifi network ?
Thank you very much for your help.
You cannot programmatically modify the selected WiFi on iOS without using private API. I think this post describes what you want.
I think it is very unlikely for Apple to change this, therefor I suggest using a web service to upload the data to and a push notification to the computer to tell it to download the data once it has finished uploading.

Is it possible to create a local WiFi network with Cocoa while staying connected to an existing Internet-enabled WiFi connection?

I do a lot of development that requires creating local networks on my machine in order to connect to them on my mobile devices. When you create a network, you disconnect from your existing network and lose internet access. Is there any way to programmatically create a network while still maintaining a second WiFi connection that can access the Internet?
As an aside, it's possible on the iPhone - when an iPhone connects to a locally created network, it somehow detects that it's not a real Internet connection and maintains its 3G connection while also being able to interact locally with the host computer.
No. It's not a matter of the software; most wifi chipsets only support being associated with a single network at a time.
The iPhone is able to avoid this because its 3G connection is a separate network interface from the wifi connection. If you have another method of connecting your laptop to the Internet, though, such as wired Ethernet, you can use that to get the same effect.

Communication between iOS app in one Wi-Fi network w/o server

I need to communicate my app with 2 devices. A restriction is that I can't use a server but all iOS devices will be in one Wi-Fi network. What options do I have? How I can send a message to another copy of my app running on another device?
I dont know whether its a correct approach or not but as you cannot use server,so the approach i can think of is we can create a socket connection using TCP/IP or UDP(based on reliability) for data exchange.
I dont think you can communicate between 2 devices running the same application without having some kind of server application in-between.
Even if you could find the other device over the WIFI I dont think you can tell if the other device is running the app or not.
I think you may be referring to MultipeerConnectivity
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).
Source: https://developer.apple.com/library/ios/documentation/MultipeerConnectivity/Reference/MultipeerConnectivityFramework/
Apple Sample:
https://developer.apple.com/library/ios/samplecode/MultipeerGroupChat/Introduction/Intro.html

iPhone chat application

I have try to make chat application with socket programing and I am using Chatty source code and its working perfect on same network. But not work for different network.
Is chatty work for different network iPhone?
I have tried chatty for different network in iPhone but no success.
Any idea about chatty for different network for iPhone?
From looking at the source code for Chatty, it seems that it just uses an IP and port number to connect to a different device, and that's the reason why you can't connect when users are in a different network. Being able to connect or not will depend a lot on the network configuration you both of your devices have.
For example: it works if you're in the same wifi, because there's no firewall between the devices, and the IP is reachable (192.168.x.x, for example). If you take one of the phones to a 3G network, it won't be able to reach the other one in the wifi, but the one in the wifi might still be able to reach the one on the 3G, depending on your career and port number, and if the network stack is on in the phone. So, conclusion is: this will be highly unreliable.
Usually, for this kind of communication, apps rely on a third party, so both of your phones connect first to a webserver, that is always available on the internet, and the web server sends the messages to each of the apps. This also solves the problem of one app going off the network (when you take an elevator, for example).

connecting to multiple peers over wi-fi

I have to implement wifi connection with more than one device at a time. In the current example, if i am connecting any two peers, data can be exchanged between them but those devices are no more available in other devices.
I want to implement something like server-client over wifi. In which server can communicate with all and client can communicate with server. All simultaneously.
It is something like this post
I want to know is it possible to connect with more than 1 device simultaneously over wifi? If yes, then what is the maximum number of devices that can be connected in same pattern?