Friday, June 1, 2012

Getting started with PhoneGap

What is PhoneGap? PhoneGap (now known as Apache Cordova) is an open-source mobile development framework originally created by Nitobi, purchased by Adobe Systems. It enables developers to build applications for mobile devices using JavaScript, HTML5 and CSS3, instead of platform specific languages such as C#, XAML, Java, XML, Objective-C etc. The resulting applications are hybrid, meaning that they are neither truly native (all layout rendering is done via the webview instead of the platform's native UI framework) nor purely web based (they are not just web apps but packed for appstore distribution, and have access to part of the device API).

The following are the features of PhoneGap :

Building applications for each device like iPhone, Android, Windows Mobile etc. requires different frameworks and languages. PhoneGap uses standards-based web technologies to bridge web applications and mobile devices. Plus, because PhoneGap apps are standards compliant, they’re future-proofed to work with browsers as they evolve.

PhoneGap is an open source implementation of open standards. That means developers and companies can use PhoneGap for mobile applications that are free, commercial, open source, or any combination of these. The PhoneGap SDK provides an API that is an abstraction layer providing the developer with access to hardware and platform specific features. As PhoneGap abstracts the native mobile platform, the same code can be used on multiple mobile platform with little or no change, making your application available to a wider audience. By default, PhoneGap provides access to the device camera, accelerometer, file system, GPS location, and media playback among other capabilities. However, PhoneGap does not expose every native API for use within your JavaScript applications. If you want PhoneGap to do more than its default feature set, you can use the PhoneGap native plugin model to extend the capabilities of the core PhoneGap API. Native plugins in PhoneGap are not like plugins in desktop browsers; rather they provide a way for you to plug in custom code to add to what the PhoneGap application framework can do. PhoneGap native plugins enable you to create completely new, custom functionality in native code, and expose that to your PhoneGap applications via PhoneGap's native-to-JavaScript bridge. This means that you can expose any native library or framework for use within your JavaScript-based PhoneGap applications.

Official PhoneGap website:

You can take a look at the apps that have been previously made using PhoneGap :

PhoneGap allows you to build the apps for different platforms using a single code base. Having said that, you still have to install the SDK of every supported platform for which you want an app to be built. For instance, if you are working on PhoneGap using Visual Studio Express Edition 2010 for Windows Phone, and you want an Android build, you have to port the same code to Eclipse, and the Android and PhoneGap plugins need to be installed in Eclipse beforehand. So if you are targeting 6 platforms, you need to have six SDKs installed and manually generate the builds for each platform. Feeling too lazy already? Here's a workaround that the PhoneGap developers have come up with - the PhoneGap Build. Forget all the pain with the SDKs, code once and compile on the cloud. It automatically generates builds for all the supported platforms! That's like a charm!

You can read more about compiling on the cloud here :

All the public apps are free and are hosted on Github. You get to host one free private app and you have to pay for any subsequent private apps. The plans are as given below:

On the whole, PhoneGap is simple, fun and saves a lot of time by just writing a single code. I have just started working on PhoneGap and hope to learn a lot in the process :)

No comments:

Post a Comment