Saturday, May 4, 2013



Smart phone growth has been more than 100% since 2007. With big companies like Google, Apple, Microsoft, Firefox fighting to get a place in this gold rush seems like mobile is the future. With so many operating systems the number of frameworks which provide solution of code-once-deploy-on-all has also increased considerably. Phonegap and titanium being ahead in this race.
Other frameworks being SAP, Scylo, Kony, sencha, Antenna etc.

I personally have worked on phonegap, Titanium and native development. I will share my experiences on both these frameworks and then lets compare it to native dev.


Phonegap:

Phonegap helps you build mobile apps for multiple platforms using web technologies. The whole app runs inside a web view (something which can render HTML5/CSS/JS). They have exposed APIs for camera, contacts,media etc. The whole thing of using a web view can also be done without actually using phone gap and writing javascript interface to talk to the native APIs. But why reinvent the wheel?
Link: http://phonegap.com/

Pros:
1. Minimum learning curve. Really useful if you want a basic version of your app to be up and running quickly.
2. Porting to different operating system is not very difficult. But you might expect some changes.
3. Open source community is also big. You can find many plugins for individual platforms here : https://github.com/phonegap/phonegap-plugins

Cons:
1. Native UI is definitely faster and better. Especially in iOS you may have to work very hard to bring it even close their standard (Animations/Navigation. Tip: use css animation instead javascript). Thats why apps like Facebook and tumblr have moved away from HTML5 towards native.
2. Not for complex apps like games or something which requires high graphics.
3. Apple has been rejecting many phonegap apps but phongegap claims that after their 1.8 release they are not breaching any of there terms and conditions.


Titanium:

Titanium is used to develop mobile apps using their javascript SDK. The UI is in native. They claim that 60-90% of your code is reusable when deploying to different platforms.

Pros:
1. Native UI
2. Framework is cool because with strong knowledge of the framework and JS you can build really useful components and overcome the drawbacks.
3. Supports more than 5000 native APIs

Cons:
1. You start developing for one platform and then while porting have to write a hell lot of if statements. And eventually end up with different code bases.
2. With native of both android/iOS evolving so fast your titanium app might be left behind.
3. Constant reports of memory starvation.



Conclusion:


Titanium is obviously more complex because they are trying to achieve code conversion (What they do actually is to pre-compile your app into native symbols. Obj-C in iOS and Java in android). Compared to Titanium Phonegap is a very straight forward solution of sticking to HTML5 view. So Titanium has to do a lot of work of refining their logic as well as cope up with quick updates of the operating systems (like fragments in Android, solution to supporting different device resolutions and sizes). Where as phonegap's UI experience is limited only to what HTML5 can do.

Well my take is if you really don't have much patience and money to invest in development/learning and want your app in the market using your JS/HTML5 skills you can go forward with phone gap. Or if you don't have a very complex app, don't want to learn new language and want it to be native while maintaining code reusability go with Titanium.
But remember eventually things have to scale and you might find it difficult to cope up. Mark Zuckerburg: "Our biggest mistake was betting too much on HTML5". Mobile is certainly going to get more complex with time. Looks like major players who are going to rule market are going to be iOS and android. Windows also showing some improvements in market share. They have exposed their APIs in JS for development.


Thanks,
Abhinav