If you ever wanted to embark on a mobile development mission and were intimidated by iOS or Android APIs, there is a third alternative. The portable and familiar ground of web programming can bridge the gulf between major mobile platforms. The bridge is called PhoneGap, which I thought would help you develop mobile apps too – with the ease and efficiency of web programming, all the while not losing a lot vitamins from native hardware.
I do not do mobile development for my day job, but I had ventured out a little bit into mobile app development in the past. The main challenge in developing apps for mobile platform is that the platform itself is highly fragmented and the flavors are not inter-operable. For instance, if you would like to develop an app for Apple iOS devices, you need to learn Objective C and iOS SDK to the core. Once you have developed your app from the bottom up, you will realize that not even a single line of code you wrote will ever work for Android, which depends solely on Java language. I am not even daring to talk about Windows Phone OS nor Blackberry but I know just enough to claim that they too use incompatible development frameworks. Each mobile platform created its own ecosystem, in its quest to capture market share by being unique. It appears that the platform independence that we achieved to some extend in the last century with the personal computer revolution was completely erased when we moved forward to mobile computing. A big step back indeed.
A Personal Story
A few years ago, I wanted to develop an iOS app. After many weeks of desperate attempts, I was finally able to get a handle on coding for iOS using Objective C and Xcode. Even though, I was well verse with C coding, I found some of the Objective C features completely non-intuitive. Concepts such as named parameters and SmallTalk-like messages were some what alien to me. Moreover, I found Xcode (Apple’s development environment) as a tool evolved from a primitive era. I am not stating these to start flaming or to create a controversy. It might be purely my inability to get used to different programming paradigms. As a long time developer, who migrated from vi editor to Eclipse IDE, I found it difficult to deal with multiple window system of Xcode (I used Xcode 3.x version or so. Apple somehow glued those Windows up togther when it came to Xcode 4.x) and strange UI development conventions of Interface Builder. After 3 months of intense struggle, I finally shipped my app to the app store. It did not become an instant hit, but it made me feel proud of myself – for a while. In the process, I learned a bunch of things.
I wrote about this experience to point out the struggles of developers to cope with multiple platforms, multiple operating systems and multiple form factors (screen sizes ranging from 3 inches to 10 inches and all possible decimal points in between). If portability were the only determining factor of measuring progress in the world of computing, we would have to admit that “mobile revolution” was a huge step backward, compared to the PC computing. iOS (Objective C/OSX/Xcode/Cocoa touch), Android (Java/Dalvik), Blackberry (C++) and Windows (.NET) chose to travel totally different paths, in their selfish quest to capture their share of mobile market.
Too bad. At least for the mobile developer.
Why Phone Gap?
Exciting benefits of PhoneGap
- Obviously time to market is another benefit. As mobile world is evolving quickly, getting apps on the ground as early as possible is critical.
- Developers can focus on business logic rather than resolving the quirks of OS features.
What is Not-So-Exciting?
- PhoneGap is a web-based framework. It can do what a browser can do – for the most part. If your purpose if to build visually jaw-dropping UI experience, go native. HTML is still an evolving platform, but I am sure it will get there in short order.
- Each mobile hardware has different features. Accelerometer, Gyroscope, camera, NFC, .. the list goes on and on. While PhoneGap has many plugins for some of the hardware features, there are still some gaps. However, you are not entirely out of luck. Developing an OS specific plugin is not out of reach. Such development will be following a hybrid approach – native SDK as well as PhoneGap SDK / HTML, but is surely worth pursuing.
“Okay, I am convinced, what should I do to get started?”. The procedure to get started with your Hello World app is well documented. The following resources will help you to build your first app (how can the first app be anything but “Hello World”?). If you want to develop for iOS devices, you need a MacBook Pro or a similar Apple desktop, Xcode 4.x and a jug of freshly brewed coffee. For Android, you need a PC/Mac/Linux machine. Thats it.
I will write details of how to install and get started with PhoneGap with iOS as well as Android in subsequent posts. I am trying it out myself and I will be glad to share my experiences here. But if you are impatient, please use the link below to dive in.
It is going to be entertaining as well as exciting to watch how the mobile landscape evolves.