Controlling Network Settings in IOS 5 - objective-c

I have a project where it's highly desired to have some control over network settings in IOS 5 for an iPad device. The ideal scenario would be to have to ability to change the device's wifi connection to a specific SSID. My gut tells me that this is probably functionality that isn't exposed in the SDK but I figured I'd ask.
An alternate goal, if my first assumption about directly changing a connection is correct, would be to allow the app to prompt the user to change network settings and direct the user to the settings screen. I've seen a handful of apps offer this when, for example, the device is in airplane mode and the app requires an internet connection. The major difference in my case is that I'm not necessarily looking to prompt the user just when the device is not on the internet but when whatever connection the device already may (or may not) have isn't the one I'm looking for (in this case, I'm looking for a closed/non-internet-facing Wifi ssid on an aircraft).
I appreciate any pointers that can lead me in the right direction.

It might not fit perfectly what you want but I think CaptiveNetwork is the closest you can get.
The API bindings for CaptiveNetwork are available in recent MonoTouch releases.

Related

Starting an app in snapped view on an embedded system

A colleague recently asked a similar question ( How to start a MetroApp directly in Snapped mode? ), but this question is not a duplicate...
Programmatically forcing a Windows Store app to open in snapped view does not seem to be possible – by design. But can you do this or something similar on a Windows Embedded 8 machine? Similar things could include:
automatically start an app in snapped view on system start up, or
always start a specific app in snapped view
???
What we are trying to achieve:
The user logs in (on a preconfigured machine, assembled by us, possibly running Windows Embedded 8), starts our app and a snapped communication app (e.g. Skype or Lync) is (A) automatically there alongside our app, or (B) can be opened by pushing a button in our app.
Developers have the API necessary to take their app from SnapView to Fill or FullView. This is usually a less-advertised API because it could easily be abused. To that end, the reverse is not available. There is no API to move to SnapView.
I might also caution you, that unless you are sure of the device resolution, starting in SnapView (which is not possible as it is) would be a dangerously unreliable step as many (most?) displays do not support it (too small). And since you are talking embedded, I imagine this might be exaggeratedly so. Since it sounds like you might know the hardware, you can take that as a general rule, not for your circumstance.

How to link to a specific preference pane in iOS 5

Background
The company I'm working in would like to launch an iOS app to support an hardware device that interacts with some mechanical automatism (aimed to home and building automation) we already produce.
Such automatism receives the pulse needed to activate itself from a nearby bluetooth device, whose MAC address is known by a white list.
We already know of the need to sign up to the MFi program for Bluetooth hardware to connect and talk effectively with Apple devices, exchanging significant messages, but what it is demanded here is to simply detect the presence of such MAC address. No need to establish protocol sessions and the like.
The facts
Investigating how to programmatically enable/disable Bluetooth interface in iOS, I learned it is impossible without private frameworks, as this post states; that is not an option for us, as the app has to be published on the App Store and it is known that Apple rejects apps including code that is coming from private frameworks.
By the way, the app usability would greatly benefit from a direct access to that feature, so I started thinking if, instead of directly interact with Bluetooth on/off state, would it be possible to let the user access to the Bluetooth preference pane straight from the application.
Does anyone know about that?
No, unfortunately it's not possible. There was a trick with:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"prefs://"]];
but it was opening only the preferences (not straight to bluetooth settings) and it's disabled in iOS 5.1. So your only chance is to make a really good help screen (with nice graphics and animations maybe) that explains the user how to enable the bluetooth.

Connecting 2 iDevices via Bluetooth automatically

So I don't like how I can connect two iPhones with game kit, because you have to choose the iPhone you want to connect to, the other iPhone has to accept... I think this way sucks. I want to have the Bluetooth ON on my two iDevices and I want them to connect automatically between them. Is there a way to do this, or does Apple not approve of it?
I believe it's Bluetooth that won't let this happen. Check out the options presented here: http://en.wikipedia.org/wiki/Bluetooth#Pairing.2FBonding
You can see that only the first SSP option could possibly allow a non-confirmed pairing, and that's not available for devices with security capabilities.

Turn iPhone into a server programmatically?

I want to make my iPhone app display on a Mac's screen, kind of like AirPlay does with other machines. The only way I have heard to do this is, although I do not like it, turn the iPhone into a server. Unfortunately, I cannot figure out how to do so. I also wanted to set it up in such a way that my Mac automatically detects it. I have seen a similar setup in the game Chopper 2. My Mac app will have a simple timer that fires every few seconds to look for the iPhone, in the same way that Chopper 2's "Find iPhone" button does.
Is there a simple way to turn the iPhone into a server, or start a "session" like Game Center does?
One last thing: I know it is somehow possible, because another app I have actually gives my iPhone a web address at the click of a button. It is called the Dicenomicon, if you want proof.
First there is no easy way to redirect your display to Mac, even if you made it a server of some kind.
Second, to discover or publish customized services on WLAN, you may want to refer to the samples on Bonjour:
CocoaHTTPServer: a simple TCP/HTTP server.
WiTap: an app that discovers and connects to services of the same kind on WLAN by Bonjour.
I'm not really sure what you mean by "server", because there is no way to share the screen of an iPhone using the official SDK, although this is possible by jailbreaking.
It would be possible, however, to send data back and forth between the Mac and iPhone, and display the data on the iPhone, on a Mac. Using that data, you could try to recreate the interface on the Mac. All of this could be accomplished using sockets. A class that might help with that would be cocoaAsyncSocket, which makes network programming a lot easier.
The auto-discovery of iPhones on the local network is achievable with Bonjour. Without getting into too many details, NSNetService would allow you to publish a service for your app from an iPhone, and NSNetServiceBrowser would allow you to find that service on the local network from the Mac. From the NSNetServiceBrowser, you could establish a socket connection with the iPhone.
Good luck!
You might want to take a look at the GameKit APIs, I know they do something similar between two iOS devices.
http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/GameKit_Guide/Introduction/Introduction.html

Robust real-time communication between iOS App and Mac App

We're working on an exhibit (http://pulse.media.mit.edu) and I'm brand new to iOS, objective-c and Xcode. The exhibit deadline is in one week and I'm stuck.
The problem I'm having seemed simple enough.
Our exhibit has a projector and an iPad. The projector will be hooked up to a mac and be playing a video. The iPad will act as a controller for those videos. More simply:
I have 50 videos on a Mac. I need to develop an application on the Mac, that, when opened will loop one of the videos.
On an iPad, I need to develop an app that can change between the videos on the mac in real time. The iOS app is already designed, we're just struggling with some code.
On the mac, when the iPad tells the Mac to change video, we'd like it to switch between videos using Core Animation, like this (http://youtu.be/pyd8O-2mkgk?t=1m).
So my question: What is the most robust way to do this? It has to be able to run in a museum, for two months. Some things to consider:
We are 4,000 miles away and can't monitor it all the time. We'll
check nightly to see if it's still working, but it should run the day
without breaking.
If people unplug the iPad, it should still work.
It should be as robust as possible.
How can I best do this? Should I write to a database from the iPad onto a database running locally on the connected Mac and then monitor that database 10 times every second? Are sockets robust enough to use alone?
If you do suggest a way, can you please point me in the direction of some resources (frameworks, function names, etc) that can help me do this quickly?
Thank you for your time.
I would go for the server-in-the-middle option, because it will be easiest to debug, and requires nothing more than a working internet (wifi) connection on the client side. When having connection issues, all you need is someone who knows how to hook up an iPad or Mac to the internet. And you can see server-side which device has issues connecting.
Furthermore, using plain HTTP sounds like the best way to go for communication, and the backend can be written in any server side scripting language. Both clients should be polling the server every X seconds.
If you get this basic setup working well before your deadline, you could try to get the devices to connect to eachother directly (for a less sluggish user experience), and leave the server solution in there as a fallback method. The Mac app could function as a HTTP server, accepting the very same commands that the iPad normally sends to your server. The challenge will be to reliably know which IP to connect to. You could hardcode it or use Bonjour.