Cross-platform mobile development: Phonegap, Corona and Titanium

Update: You want to check out the comment section. Eric, involved in developing Corona gave some updates on the state of Corona on Android. Also, the license is 249$ now.

Edit: holy shit. I pressed publish and saw the outcome of this. I’m sorry for that wall of text. At least i now know that writting that book is not a problem… Make sure you check out the other article of today, it features a nice surprise!

After my initial contact with V8 yesterday i talked to Blitz about the possibility of developing a cross platform environment based on V8 with support for a couple of APIs. This should mainly be used in the context of game programming.

Blitz, who’s working at a mobile tech startup of course knows his shit and pointed out that there’s a couple of frameworks that do something very similar already. I’ve never been first with any idea :p

The first framework is called Phonegap. It’s an open source effort to provide a framework for cross-platform mobile development with Javascript/Html5/Css3 exposing native mobile phone capabilities to the Javascript app. On all the supported platforms (Android, IPhone, Blackberry, some shades of Nokia etc.) it works like this: Write an app with Javascript/Html5, use a special Javascript API to access phone features such as the accelerometer or the camera, profit. Phonegap basically sets up some type of WebKit view wrapped in a platform specific application (e.g. Activity on Android) and then abuses the WebKit view’s API to connect native methods to Javascript. So you basically have a web app that has access to native functionality. The approach is pretty ingenious and they support a wide range of platforms already. The downside: a lot of the API is platform specific, meaning that you’ll have different code paths for different platforms. There’s also no debugging available given the fact that the Javascript engine of the WebKit views can’t be hooked up to a debugger. A native look and feel is also near impossible to achieve with the current implementation and i doubt that this will change in the foreseeable future. So you get to develop web apps which get packaged in native apps and can use native functionality but only by extensively splitting up code paths for different devices. It’s free though and the community is very active it seems. For smaller apps it might well be a workable solution.

The second cross-platform mobile development framework i got to know today is called Corona. It currently supports IOs and Android, altough the Android port seems to be unusable at the moment judging from the posts on their forums. Corona takes a different approach which i’d prefer to Phonegap. They use Lua (yeah, remember Lua?) as their language of choice and actually compile to native code from what i could gather. Corona is very focused on graphically rich applications with a lot of animations. It comes in two flavors, a general SDK and an SDK specifically for 2D game programming, including a small Box2D wrapper. They also provide means to debug an application, albeit without IDE integration. The debugger is a pure CLI app which might turn off some of the potential users (i love my gdb…). They also have a simulator (which is not an emulator!) and i assume that you can only debug on the simulator. I couldn’t get my hands on the trial version as i don’t have a Mac. Oh, did i mention that you need a Mac to develop with Corona? For me that’s a no-go i’m afraid. They business model revolves around yearly subscription fees which isn’t a bad thing. Currently it’s 99$, after the beta it’s going to tbe 299$ a year. As is the case with Phonegap Corona does not support any kind of native UI elements. That might well change in the future. Given that the developers seem to be behind schedule i doubt that this will happen soon though. Still worth checking out. If you got a Mac…

Finally there’s Titanium for mobile (there’s a desktop version too for different browser from what i can tell). It also uses Javascript as the language of choice but as oposed to what i’ve read on the web about Titanium (Phonegap WebKit trick) it seems that they use Mozilla’s Javascript engine and hook that up to the native UI toolkit on each platform. Yes, that link is that long intentionally. it references actual Titanium source that i’ve found after browsing their git repo for 2 minutes. Titanium has a huge API and by huge i mean really fucking huge. Most of the things they expose are really cross-platform. And the nicest bit is that you actually use the native UI toolkit on each platform. There’s some special classes for different platforms but those are small and only offer minor additonal functionality. It seems that they’ve succeeded in finding the largest common denominator between all those UI toolkits and present that to the user via a unified API. Very nice indeed. Titanium also features debugging capabilities from what i could tell. How that works out with IDE integration i’m not sure, i think that is done in a seperate application that comes with the SDK. Don’t take my word for it though, check out their site. The only downside: it’s not meant for game development, which i don’t find that problematic actually. Their business model seems to revolve around adding value via paid services. There’s a free community version which seems to have all you really need. If you need additional training and support you can pay a monthly fee.

For me Titanium is the clear winner. It’s also the package that seems to be the most professional. Phonegap is a very nice idea but i don’t see a lot of use for it (unless you want to sell your web app in the app stores, but who wants to do such a nasty thing?). Corona seems actually well suited for 2D IOs game development. It’s not such a great thing on Android at the moment due to performance problems.

Of course everything i said here should be taken with a grain of salt. I did not try out any of the frameworks but only summarized what i could gather from their docs and sources. I’ll stick to native code for the moment 🙂

10 thoughts on “Cross-platform mobile development: Phonegap, Corona and Titanium

  1. Thanks for your useful article. Currently I’m using Titanium to develop app for iPhone and Android. And I see Titanium is so great. It help me develop app quickly.

  2. Rock on. Good overview. I just crashed and burned trying PhoneGap all weekend. Too many layers to slow ya down. Didnt want to learn XUI to build the UI, JQTouch bogged down too slow. Now looking at Titanium too. Thanks !

  3. First, I work for Ansca. Thanks for this review! I have a couple comments:

    We have recently updated Corona, especially in the Android area. We do regular release to fix bugs and add features, so you might want to check us out again (although it is true that at the moment we still require a Mac). The basic product is $249, not 299.

    Corona does support some native UI, specifically alerts, web views (if you can call those native), and text fields.

  4. There is also Smartface Designer which is a cross-platform. You can develop mobil apps without writing any line of code. Also it work for multiple platforms like Symbian,Java, BB…
    It is the easiest way to develop mobile apps and it is free
    check out from http://developer.smartface.biz

  5. Hey, you funk soul brothers! Check out Application Craft http://applicationcraft.com

    jQuerymobile has announced AC as a JQM dev platform and here’s a case study that Phonegap did on them : http://phonegap.com/case_study/phonegap-application-craft-pain-free-mobile-app-development/

    In summary, it’s a cloud-based dev platform that does mobile (all important platforms) and desktop on an equal footing. It’s got an IDE that does drag-and-drop / wysiwyg UI building as well as code editing. I guess you could describe it as Visual Basic in the Cloud, but Javascript not Basic. Widget based like VB was, extensible. Open Source with free platform offering.

  6. There is also Moscrif SDK available as an alternative to those stated above. In my opinion it is currently the best Corona alternative, but is free to download. Also, there is no need to learn Lua as Moscrif uses well-known JavaScript. Find out more at http://www.moscrif.com

  7. Developing the apps in cross platform development is pretty much easy
    and inexpensive. Developers need to put fewer efforts and the languages that
    are used for cross platform app development like HTML, Javascript and CSS are
    famous and easy to learn and use. There are so many frameworks and tools are
    available in the market which are used for development of cross platform
    development.But my choice is PhoneGap ,developers choose any 1 according to project need and budget.

    phonegap application development

  8. I’d recommend V-Play from personal experience. V-Play is aimed at all levels of developer but has a very gradual learning curve, making it a great option for beginners.

    http://v-play.net/

    It’s a cross-platform development framework based on Qt that can be used to develop both apps and games. You can develop your game on any system and deploy it to every app store, meaning you never have to use native SDKs.

    They have a lot of beginner tutorials showing you exactly how to get started. There also a lot of in-depth tutorials like “how to make a Flappy Bird game”.

    http://v-play.net/doc/howto-flappybird-game/

Leave a Reply

Your email address will not be published.