Thursday, December 12, 2013

Phonegap introduction


In this tutorial we will discuss what is phonegap and what makes it so cool

Phonegap is a mobile development framework it was originally built by Nitobi and later was purchased by Adobe systems. Phonegap helps you to create mobile apps by making use of HTML5, javascript and CSS instead of the device specific language (Objective C, C#, Java).

The apps which are made in phonegap are called as hybrid apps, hybrid apps because the UI rendering is done as part of web and to call the native controllers like the image, camera or sqlite database etc you have access to these device specific API’s (we will talk about it later). If you are planning to use phonegap in your next project then I would suggest you to make sure that your HTML, CSS and javascript skills are clean.

By using phonegap you are at the same time developing apps for multiple platforms, you can take advantage of the concept called as plugins to do device specific work in case if you do not find a device API for the same.

Example: If you just want to show a native alert in a phonegap based app, then you can write your own plugin.

The app, which uses phonegap framework, makes use of the native webview, all the styling and UI rendering is maintained with the help of CSS and javascript. Also note that phonegap is an open source framework.

The various operating system supported by phonegap are as follows:

Apple iOS
LG webOS
Windows
Symbian OS
Blackberry
Bada OS
Ubuntu touch
Android

While beginning the learning phase a question raised in my mind like whenever I search phonegap this cordova thing used to come up and it was like so confusing at the first place but finally got the answer to it.

Above I mentioned that now phonegap is owned by adobe, what adobe did later was they donated the phonegap codebase to Apache software foundation (ASF), later phonegap was renamed to Apache callback which the apache community found was not so cool so they renamed it to Cordova, Cordova hmmmm is their  a meaning in this name while yes phonegap was a project that was born in Nitobi company which was located in Cordova Street in Vancouver,well now the name makes sense.

The next question that I had in my mind was like what is the difference between phonegap and Apache Cordova?

After visiting few links I found that you could think of the apache cordova as the engine that powers a car named phonegap. To be more specific Apache cordova has a set of device level API’s with the help of which you can access the device level controllers like the accelerometer, camera, etc with the help of apache cordova you can build native mobile apps using HTML, CSS and Javascript.

Coming to phonegap now, phonegap is a distribution of apache cordova you may think of apache cordova as the heart and phonegap as arteries that supply blood to all the parts of your body. So basically that makes phonegap as the supplier of cordova and its device based API’s.

If the above example did not impress you then here’s a common example that you might have came across, you can think of cordova like the webkit which powers safari or chrome.

If you want to know more then here’s a FAQ guide from phonegap itself.

If you are planning to install cordova then please visit this link that contains simple step by step written for installation. Also you need to download the cordova source from here because to create cordova based app you need to use the command lineterminal.


I hope that i was able to clear few things regarding phonegap in the next post we will see more about it, if you have any question then feel free to mail me or leave it as a comment until then Happy iCoding and have a great day.