Native Development, Titanium, Corona, Unity, Phonegap and more
Ever since the iPhone has revolutionized the mobile phone and everything about it, there have been several tools out there to create apps for the iPhone, the iPad and all the Android driven devices. I have been toying around with some of them and reading up on others. I concluded that there’s a lot of tools out there and every single one of them is completely different. The thing that struck me the most though, is how many people don’t understand the differences. So here goes a blogpost about the different tools I’ve come across and what they actually do. I’ll run through them starting from the easiest ones to get started with to the more hardcore ones.
I’m very aware I might be forgetting some tools. However the ones listed here are the only ones I actually used at least once. Feel free to add other tools, the way they work and your findings about it in the comments.
Note: If anything, I consider myself an iPhone developer, not so much an Android developer, let alone a mobile developer. My findings and views on things are based on my preference towards iOS development. I’m not bashing the Android Platform. I just know more about the iOS platform. I just wanted to state that for the record before you read on.
I’ll kick off with Phonegap. Why do I think this is the most simple one? Well, it actually doens’t require the knowledge of anything new to create your first app. If you have ever built a mobile web app, you can create a Phonegap app.
Phonegap is essentially a web app -the same one you built the other day at work- embedded in a native wrapper. You build the app using HTML/CSS and Javascript. You can use plain old Javascript or make your life easier by using jQuery, Prototype, Sencha Touch, MooTools, etc to handle the interaction. Just like any other mobile website.
What the enduser sees is in effect a web app running inside a webview. So what’s the native wrapper for? Well it provides Javascript API’s to give access to the contacts, filesystem, camera, microphone, GPS, etc. Phonegap provides the bridge to the API’s normal web apps can’t get access to. It’s that simple.
Personally I don’t see the appeal; most definitely because the browser performance doesn’t come close to native app component performance. Think about scrolling through a list of 1000 entries.
I know a lot of people babble on about how you can ‘just turn your webapp into a native app‘. But what’s the point!? That native app doesn’t provide anything the web app doesn’t and it’s an app. You could as well make it a full fledged web app which users can just add to the homescreen.
URL: Phonegap
Yea, you didn’t see that one coming, did ya? Yes, Flash can create iOS apps too. And of course you can create Android apps too (and you can even create Flash websites for Android!). Why does Flash come second in this list? Well anyone who can create a Flash app could create a iOS app using Flash. The eagle-eyed viewer has already noticed how I mentioned could in that last sentence. I have tried to create several apps (that actually do something) and every time I ended up realizing the same one thing: It performs like shit.
For those of you who don’t know: I spent the past 7 years being an active Actionscript developer. I’m not what one might call a Flash-hater. I’ve tried to create simple games and apps for iOS using Flash. A game using the accelerometer (which crashed when too much accelerometer data came in simultaneously. Limiting that datastream kind of went in the way of the actual game) and an app using the microphone (processing microphone input on an iPad 1 was so hard that any UI interaction would make the audio playback stumble). Both of them ended up staying ideas until I finally get my head around native iOS development.
Flash can compile native iOS apps. Those apps are not interpreted at runtime. Adobe says they’re actually generating the native binary that you would get if you built it using Xcode. Seeing how the performance of several natively-built games is perfect and Flash-generated apps (not even games) perform horribly, I’d say Adobe has quite some work before making Flash a viable tool for (at least) iOS development.
And I know what you’re thinking right now: “Dude, what about that Flash game that made #1 in the app store, not too long ago?“. Yea… Let’s talk about that… Why didn’t it run on my 1st generation iPad? Did the app need a camera? No. Then what else does the iPad 2 have, that iPad 1 doesn’t? Yes: CPU/GPU power. Let’s face it: It’s not an overwhelming 3D game. It’s a 2D game. It should run just fine on the 1st generation iPad. In comparison: The Back To The Future game (which is completely in real time 3D) runs just fine on my iPad 1. And so does the (rightfully named) Epic Citadel demo featuring the Unreal engine for iOS.
And if you have ever created a Flash app, you know how annoying debugging can get. Well debugging a Flash app on a device isn’t exactly what I’d call fun.
URL: Flash CS5.5 – Flash Builder 4.5
This is actually my favorite. It gives best of both worlds. Titanium provides close to native performance (by using the native components) whilst having a simple and powerful API that gives access to just about any interface either iOS and Android has. I created a few apps using Titanium and all I can say is: It’s the fastest iOS app development tool I’ve seen yet. You can create great looking and feeling applications in very little time.
You create the app writing Javascript and calling Titanium’s APIs. “How is this different from Phonegap” you think? Well, the Javascript you write is interpreted at runtime (I’m guessing a WebView). However this webview is invisible and ONLY does business logic. In fact: It only does custom logic. For example: When you create a TableView, you call Titanium.UI.createTable()
in Javascript. This calls a Titanium API that runs native code in the background and returns a native iOS/Android component with native performance. You populate the table component using more Javascript. Once the data is in there, the table behaves exactly as fast and smooth as any other tableview in iOS… Because it is a tableview in iOS. (Or in Android… You get the point)
The Javascript calls to the Titanium API are mapped to native code in the Titanium framework and generate native components. Events in those components are sent back to your code in Javascript where you can handle them. The end result is very fast performance. The slowest part of any Titanium app is app logic/handling events in Javascript (and let’s face it: That’s still faster than you can blink). The UI interactions, UI animations, UI effects and some platform specific calculations are completely native. Yes, native is key here. It means performance. Better performance means allows better user experience. (Some people still mess it up, even if performance is as good as it can be).
That native performance is wonderful. That’s why I love Titanium. The only bad thing I’ve come to notice. You can’t do any kind of image processing. So if you’re thinking about building the next Instagram(Camera image processing App: Instagram), don’t use Titanium. Even though you have complete access to iOS’/Android’s camera API, you can’t heavily edit the image… And the same goes for editing audio/video. So in the end: Titanium can only create data-driven applications.
Oh btw: Titanium is free. It comes with a lot of luxury, some great tools, good debugging and access to everything native on iOS and Android! All that, for free. And open-source!
URL: Titanium Mobile Application Development
I first heard about Corona about a year ago. When I checked it out back then, I didn’t seem all that convincing and I didn’t spend much time exploring it. However when I was writing this blogpost I gave it another glance and I have to say: A lot has changed.
It looks like Corona has truly grown up and provides a massive API to create 2D games for iOS, Android and others. You write your code in Lua and when done you create a game that runs at native speed. Since I haven’t tested this myself, I wasn’t really convinced at first… until I saw the demos that were created in only a few hours and performed exactly like the blockbuster hits in the App Store. That’s immense!
Yea, remember those ideas for Flash games I had? I might just give Corona a run for it’s money. Again: Might just. If I spend 200$ for an application that should replace my free tools (Titanium & Xcode), I’d better really build a game with it.
This is by far the most exciting tool of all. One problem: Unity is designed to create 3D games. If you want to create a todo-app, this isn’t what you’re looking for.
The development environment is great, you can write the code in Javascript, CSharp and a handful other languages. The components can be put together using drag & drop. There’s an insanely extensive debugging environment. And when you feel the need to change some of the generated Objective-C code… You can. Unity generates an actual Xcode project before compiling the final app. You can access that project and change things according to your needs.
The 3D assets can be created with almost any 3D modeling application out there: 3D Studio Max, Cinema 4D, Blender and a few others. Unity even provides ways of nicely importing them. There’s also a 3D modeling feature in Unity itself, however I don’t know anything about it.
Soundscapes for the game can be created with any application you like and then imported into Unity. Again: there seems to be a sound editor/creator inside of Unity which they claim is pretty complete.
The one thing that I really love about Unity is the debugging features. It’s just brilliant. There’s several levels of testing your app.
When you’re ready to deploy your app, Unity creates the actual native app. Android, BlackBerry or iPhone (or desktop)(and soon Flash!!) are supported. And if you think the performance of this will be horrible since you’re creating a massive 3D game without writing native Objective-C: Nope. The performance is off the hook. It’s insanely good. Don’t want to believe me? That’s okay. How about Electronic Arts? Yea, if one of the world’s most famous game developers choses Unity, there is probably something to it.
URL: Unity3D
Xcode is the official toolset provided by Apple for any Mac and iOS development. And yes: This one is last in this list since, in my humble opinion, Objective-C is hard. I learned a way of implementing MVC at school but as it turns out, the one used in iOS development is very different. It requires quite some adaptation. There’s lots of strange syntax I’ve never seen. The development environment is pretty big and complex. Then there’s the .h and .m files (“What’s the difference…?“). There’s something called storyboarding that seems insanely weird at first, but actually makes total sense once you get what it’s for… Etc. Yes, Xcode is definitely the hardest tool of them all to get started.
However I don’t think Xcode needs a lot of explanation. It’s the tool provided by Apple. It’s what Apple considers the best tool they could get in the hands of their developers. And to be truly honest: It’s a pretty complete suite. It creates a native binary. There’s nothing more close to home than this.
Conclusion? There’s no conclusion! This was supposed to be a list of different tools to create apps for iOS (and Android and others) and explaining how they’re different from their colleagues/competitors.
But since you’re asking for one: I’d say depending on the kind of application you’re looking to build there’s a tool for you.