Prototype iPhone/iPad Apps with Hype
You’ve got a great idea for an iPad App, but you don’t have the technical skills to communicate that idea through XCode and Objective-C to your friends, so what can you do? Why not try Hype from Tumult. Hype creates HTML 5 webpages with exciting animations and interactions without the need to write any code.
Now this isn’t so much a review of Hype, but more what you can do with Hype to simulate a native app running on the iPhone or iPad.
Hype includes templates and preferences that help you design interfaces perfectly for the iPhone and iPad dimensions. The issue is though, Hype exports these as web pages. Ok, so that’s not so bad, but you still get the annoying navigation bars associated with Safari across the top of your prototype app that kill the illusion.
Fortunately Apple have created a little bit of code you can stick in any HTML file that tells your iOS Device to treat that webpage as a WebApp, so your webpage can be saved to the home screen of an iOS Device, and opened without having to go into Safari, and without the navigation bar across the top of the browser.
So here is what you’ll need:
1. A Mac
2. Hype (14-day trial available from www.tumultco.com/hype or you you can purchase it from the Mac App Store)
3. Dropbox (2GB free account available HERE)
4. A text/code Editor (something like TextWrangler, Espresso etc)
(Hype is super easy to use and you’ll pick it up very quickly)
Once you’ve got your Hype project complete you’re going to want to export that to Dropbox. This is a feature supported by Hype. Once your project has exported, Hype will give you the option to copy the link to your exported project. Do that! (You can send anyone that link and they can view your project. Neat!)
NOW FOR THE MAGIC CODE!
You’ll have to find your Dropbox folder now. It’s usually in your user folder next to your Documents, Pictures, Movie folders.
In that folder you’ll find ‘Public’ in there, you’ll find a folder that is the name of your project. In there is the HTML file that your Hype project lives on. (That’s the page the link you copied earlier leads to). We are now going to need to go into there and add one extra line of code so that your iOS Device will let you this is a Web App.
Open the ‘projectname.html’ (replace ‘projectname’ with your real project name) with your text editor. (I like Espresso from MacRabbit) In that file you should see some nice HTML code. If you look closely towards the top of that file you should see ‘<head>’ and then a few lines later ‘</head>’ All the code contained within here is the setup code for that page. We are going to define in here that we want this Web Page to be treated as Web App.
So somewhere in between ‘<head>’ and ‘</head>’ find an empty line, or make one, and insert this line of code:
<meta name=”apple-mobile-web-app-capable” content=”yes”>
Now save that file and close it, and you’re done!
To open that on your iOS Device, open that link you copied earlier, or right click on your ‘projectname.html’ file, choose Dropbox, and Copy Public Link, and see what the page looks like. This time it should open in Safari just like a normal webpage.
To save this to your home screen click on the box icon with the arrow on the Safari navigation bar, then choose ‘Add to Home Screen’. Name this what you like, and it will now be saved to your home screen. If you tap on that icon it will now launch like a native App!
(To add stuff like a custom icon, there are lines of code for that too. For example, <link rel=”apple-touch-icon” href=”icon.png”/> will let you choose your own icon. It will have to be in your project folder next to your ‘projectname.html’ file remember! For more advanced information, hit up http://sixrevisions.com/web-development/html5-iphone-app)

