Saturday, May 25, 2013

The iPad Kiosk Device - Redux How to use multiple apps.

Its been well over a year since I posted my experiments in making an iPad kiosk device which has been surprisingly popular.

Since various people have asked similar questions and the stack overflow thread I answered to has been locked to prevent it being spammed with comments I figured I may as well briefly address the subject here.

The questions are all really about the same thing but go along the lines of:

What happens if the app crashes?
How can I use more than one app?
The way to deal with this lies in the iOS URL addressing scheme. If you don't know what that is then go and RTFM over here.

One App To Rule Them All

Basically what you want to create is a main control app, or menu app. From this app you can re-open an app that has crashed or provide a menu to provide access to several apps. Lets look at the crash problem first.

Luckily when an app crashes (normally this means an uncaught exception has happened)  iOS gives us one last chance to so something in the form of an uncaught exception handler. Now this handler is supposed to be used to provide a message to the user or maybe log a message but we can hijack it to open up our controller.

Create an uncaught exception handler like this:

 - (void) myExceptionHandler (NSException *exception)  
 {  
    NSURL *theOneURL = [NSURL  
    URLWithString:@"MYPROTO://com.mydomain.maincontroller"];  
    [[UIApplication sharedApplication] openURL:theOneURL];  
 }  

Then register it in your app soon after launching

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions  
 {  
   // Override point for customization after application launch.  
   NSSetUncaughtExceptionHandler (&myExceptionHandler);  
   return YES;  
 }  

Now when your app crashes it will open up the main controller app which can either simply restart the app that crashed or provide a menu of apps to choose from.

To provide the ability to switch between apps without using the standard gesture based navigation which also allows users to get back to the springboard all you have to do is implement a menu/button in your app that opens the url to another app or over to the main controller using the same technique.

To save time and not to repeat things other people have explained better see this tutorial http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-working-with-url-schemes/ on how to set up an app that responds to incoming messages and how to send those messages.

Hope this helps.

Monday, May 20, 2013

Collected Ableton Live Resources

For Sam

  1. The obvious starting place https://www.ableton.com/en/articles/tags/tutorial/ (Live8 Lite)
  2. http://youtu.be/oWjIS5Me7Gw short  delay FX. Think this works in Lite
  3. Long studio mix tutorial http://www.youtube.com/watch?v=i349-AaUUrc (actually this gets a bit  dull but It was something you asked about)
  4. http://www.cosm.co.nz/ Lots of nice little tips and tricks
  5. Micro sampling http://www.youtube.com/watch?v=VeR-lVyyXcI (I use this kind of technique a fair bit to get textures, glitches etc.)
  6. Can be hit an miss but usually entertaining http://www.youtube.com/watch?v=LvjKflPM0Ec

Tuesday, May 14, 2013

Tumbleweed

Wow, been a bit quiet here. I am getting busy again now though. Pop over to iwantapinkrobot.tumblr.com to see a little project I am working on.

Friday, November 09, 2012

Time Saving XCode Code Snippets

A micro post.

How many times do you type out a property declaration? Lots.
Add this to the code snippet library in XCode.

 @property (nonatomic, <#MemType#>) <#ClassName#> <#PropName#>;  




Tuesday, July 10, 2012

Queen Of The Castle




Hiding




Bleary Eyed




Double Dummies




Doggy




Pig




Tuesday, January 24, 2012

Turning an iPad into a kiosk device

So I was asked to set up an iPad so that once an app was running it couldn't be quit. This is becoming a fairly common use case as iPads make their way into retail and other public spaces as kiosk or POS devices.

Looking at MDM solutions and combing the wisdom of StackOverflow didn't tell me how, in fact the resounding answer was "can't be done" or "only with jailbreak".

Of course if you have been into an Apple store recently you will know that this is possible because next to every display device is an iPad running their smart sign app with the home button disabled. So how do they do it?

It is actually really simple. All you need is a mobile configuration profile that sets the iPad into 'Store Demo' mode. The relevant key is SBStoreDemoAppLock in com.apple.springboard.plist and can be set with a config profile.


It is actually pretty trivial to make this work, all you need to do is install a correctly formatted mobile config plist over the air from a web server. It's possible that you can load the config using IPCU too but I have not tried this. You can combine this with whatever other enterprise configuration profiles you have in play. It also works on iPhones.

BEWARE
Once this profile is installed the first app that is launched when the device is rebooted will be the only app that will run until you reboot the device again.
To remove the profile plug the device into IPCU and delete it then reboot the device. Everything will be back to normal.


Hopefully this will help anyone else trying to the same thing only to be told it's not possible.

 <?xml version="1.0" encoding="UTF-8"?>  
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  
 <plist version="1.0">  
 <dict>  
   <key>PayloadContent</key>  
   <array>  
     <dict>  
       <key>PayloadDescription</key>  
       <string>Disables home</string>  
       <key>PayloadDisplayName</key>  
       <string>Home Button Lock</string>  
       <key>PayloadIdentifier</key>  
       <string>com.hbkill.kiosk</string>  
       <key>PayloadOrganization</key>  
       <string>My Org</string>  
       <key>PayloadType</key>  
       <string>com.apple.defaults.managed</string>  
       <key>PayloadUUID</key>  
       <string>B2D02E2D-BAC5-431B-8A29-4B91F71C9FC1</string>  
       <key>PayloadVersion</key>  
       <integer>1</integer>  
       <key>PayloadContent</key>  
       <array>  
         <dict>  
           <key>DefaultsDomainName</key>  
           <string>com.apple.springboard</string>  
           <key>DefaultsData</key>  
           <dict>  
           <key>SBStoreDemoAppLock</key>  
           <true/>  
           </dict>  
         </dict>  
       </array>  
     </dict>  
   </array>  
   <key>PayloadDescription</key>  
   <string>Disables Home Button</string>  
   <key>PayloadDisplayName</key>  
   <string>Home Button Lock</string>  
   <key>PayloadIdentifier</key>  
   <string>com.hbkill</string>  
   <key>PayloadOrganization</key>  
   <string>My Org</string>  
   <key>PayloadType</key>  
   <string>Configuration</string>  
   <key>PayloadUUID</key>  
   <string>614D1FE3-F80D-4643-AF6B-D10C4CC8737A</string>  
   <key>PayloadVersion</key>  
   <integer>1</integer>  
 </dict>  
 </plist>  

Wednesday, October 26, 2011

Lollipop

Friday, June 03, 2011

Workspace redux


Replaced my old MacBook with an iMac. With the 2 secondary screens I now have some 6,307,840 pixels of screen real estate. Sick.

Friday, March 25, 2011

In the clearing

Taking a shortcut through the trees I came across a circus.

Tuesday, March 22, 2011

Hometime

Monday, March 21, 2011

Instagram: the autotune of photography

It's technology that I guess my multiple real camera owning acquaintances no doubt sneer at but I find the results rather pleasing.

Serpentine Fog

Monday, March 14, 2011

How was your Monday lunchtime?

Wednesday, March 09, 2011

Freya's New Trick



So this morning as usual Freya is clamouring to grab my iPhone so she can do her usual turning it over and over in her hands, sucking on the corner and looking at the home screen when she manages to press the button to make it light up. Not taking too much notice I carry on getting ready but when I turn back to her I see that she has unlocked the phone and launched an app. Must have fluked the slider I assume, so I grab the phone, lock it and give it back to her. As soon as she got it back she determinedly starts jabbing at the slider until she gets it to slide across. Cue big cute baby smile.

Within ten minutes she could do it first try on both the iPad and the iPhone, another ten minutes after filming this and she had worked out pressing the home button on purpose to show the slider and then unlock.  Looks like I will have to put a pin lock on all my devices now.

Saturday, February 26, 2011

Time to lock down everything.