Pezholio

22 Dec, 2009

An iPhone app in 5 days?

Posted by: Pez In: Council Stuff| iphone

Mockup of Ratemyplace app on an iPhone and iPod touch iPhones are ace aren’t they? Despite howls of derision from some camps, in the space of a few years, it’s completely turned the mobile world on its head.

I’ve wanted to build an iPhone app for Ratemyplace – the food safety ratings website I run at the council on behalf of 8 other councils in Staffordshire for a while, but unfortunately just didn’t have time to learn Objective-C, the language that iPhone apps are built in – at the same time, I’m also aware that not everyone has an iPhone, so have been scouting around for ways to build apps that can be ported to other platforms quickly and easily.

About 6 months ago, I looked at Phonegap, which promised to allow me to build apps quickly using only HTML and Javascript. I beavered away for a few weeks, and finally had an app I was (sort of) pleased with. It used native features such as geolocation, and I used the UiUi Kit CSS library to make the app look as much like a native app as possible. I was all ready to submit it to the app store. Then the 3.0 firmware upgrade came.

My iPhone app was busted – native geolocation no longer worked, and a little hack I’d worked out to get a toolbar at the bottom and a navbar at the top was also kaputt. I tried to fix it for a bit, but other priorities took over, and the project went on hold.

Then, a few weeks ago, I came across Appcelerator Titanium, a platform that does pretty much everything Phonegap does, but (in my opinion) much better. While Phonegap uses a portion of the iPhone’s API called the webview to display webpages as though they were native apps, Titanium goes one better, it compiles your code into a mixture of web views and native Objective-C code. Like Phonegap, it also works with Android, and a promise of more platforms to come.

This means that you can not only take advantage of many more native iPhone features, your app is much less likely to be rejected (as a lot of phonegap apps were) because of the use of what Apple calls ‘private APIs’.

I dusted down my old bits of code, bookmarked the API documentation, and set to work. In the end, as well as doing my other duties, the app took me 5 days (and one beery evening) to complete. You can see a few screenshots below:

I submitted it to Apple yesterday, and I’m not expecting to hear anything for a good few weeks, if not months (Apple’s approvals processes to get an app into the app store are notoriously strict) but I’m reasonably hopeful. I’m now looking at porting my code to Android phones, with a view to looking at Blackberry and Nokia devices too.

Looking forward a few years, with the growing adoption by mobile phone browsers of HTML5 and CSS3, I can see that apps are going to become more browser based, and (hopefully), this will lead to standards being adopted across the industry, but, until then, it seems that platforms like Titanium are going to be the best way to get your apps to as many people as quickly as possible.

5 Responses to "An iPhone app in 5 days?"

2 | Fiona Legge

December 22nd, 2009 at 2:06 pm

Avatar

Thanks for this post Stuart, really interesting as i am keen to develop apps for mobiles, i will certainly be checking out Appcelerator Titanium! :-)

3 | Andrew Beeken

December 22nd, 2009 at 2:53 pm

Avatar

That’s VERY cool! Did you need to do any modification to RMP, or did the app simply work as a “reskin” of the existing site?

4 | Pez

December 22nd, 2009 at 3:00 pm

Avatar

I used the API (http://www.ratemyplace.org.uk/api) – there’s undocumented JSON feeds there too – I then used jQuery’s getJson function to grab the feed content and display it.

JSON is great for Javascript, as they’re essentially Javascript objects, so there’s no fiddling around parsing it. It’s a bugger to put together initially though – think my eyes actually beld at one point!

5 | Fraser

December 31st, 2009 at 5:18 pm

Avatar

Now we’re talking. Love this…ready to do mobile type stuff too. Can you make it provision over air?

Comment Form

Twitter / @pezholio



Desperate monetisation attempt…