At my job, I have to do a lot of stuff. If it fits into the category of media, I have to cover it. For about a month and a half, I have been tasked with the job of learning how to make an iPhone app. At first, I went at it gun-ho, downloading the iPhone developer tools, with a smile on my face. Shortly thereafter my smile was lost in the confusion of figuring out what was going on. I found out that to develop iPhone apps I needed to know programming, some programming, any programming. Well, not just some, more specifically some C-based programming language. Well, I looked into that. I got the books. I got books on Objective-C (the programming language for iPhone iOS). I even grabbed a month of learning on Lynda. But wrapping my mind around everything that it needed to be wrapped around was not that easy (for me at least). I came back to it about a month later. I had a conference one week with a week of preparation and a week or wrapping everything up with another week of other work. So when I came back to it I had barely remembered all that I studied to begin with. I went back and studied, finding it just as hard.
In frustration, I just googled “easy way to learn iPhone app development.” I got a few good hits, but the one that caught my eye the most was a nifty little program called PhoneGap. This app hooks right in with your iOS tools to enable you to design an iPhone app using web development code (instead of iPhone programming code). So you take your Javascript, your PHP, your Ruby and turn it into an iPhone app. The thought of this made everything seem so easy. However, upon further investigation, I found it actually makes a web app, not really a Native iOS app. This isn’t what I want, as I’ve read it is slower than native iOS apps, and it looks junky, i.e. you can tell it’s a web app.
However, in my search, I found another program quite similar called Titanium by Appcelerator. This app does basically the same thing, taking web code and making it programming code. Best of all, it makes it a native iOS app, running on near native iOS app speed.
How can I explain this better? I can’t. I found a great post on some forums over at stackoverflow.com that a poster named Rory Blyth had this to say about the differences between the two apps:
- PhoneGap basically generates native wrappers for what are still web apps. It spits out a WhateverYourPlatformIs project, you build it, and deploy. If we’re talking about the iPhone (which is where I spend my time), it doesn’t seem much different from creating a web app launcher (a shortcut that gets its own Springboard icon, so you can launch it like (like) a native app). The “app” itself is still html/js/etc., and runs inside a hosted browser control. What PhoneGap provides beyond that is a bridge between JavaScript and native device APIs. So, you write JavaScript against PhoneGap APIs, and PhoneGap then makes the appropriate corresponding native call. In that respect, it is different from deploying a plain old web app.
- Titanium source gets compiled down to native bits. That is, your html/js/etc. aren’t simply attached to a project and then hosted inside a web browser control – they’re turned into native apps. That means, for example, that your app’s interface will be composed of native UI components. There are ways of getting native look-and-feel without having a native app, but… well… what a nightmare that usually turns out to be.
The two are similar in that you write all your stuff using typical web technologies (html/js/css/blah blah blah), and that you get access to native functionality through custom JavaScript APIs.
But, again, PhoneGap apps (PhonGapps? I don’t know… is that a stupid name? It’s easier to say – I know that much) start their lives as web apps and end their lives as web apps. On the iPhone, your html/js/etc. is just executed inside a UIWebView control, and the PhoneGap JavaScript APIs your js calls are routed to native APIs.
Titanium apps become native apps – they’re just developed using web dev tech.
What does this actually mean?
- A Titanium app will look like a “real” app because, ultimately, it is a “real” app.
- A PhoneGap app will look like a web app being hosted in a browser control because, ultimately, it is a web app being hosted in a browser control.
What does this mean? Web developers can now become app developers. That’s great news. And if you need any more help, perhaps on catching up with code, check out htmlgoodies, quackit, or a great new site i found in the tuts+ hub – mobiletuts+. Until next time, enjoy.
Leave a Reply