Mobile Application Development using Cordova/PhoneGap
This blog post is the starting point of a series, I plan to write on creating mobile phone applications using Cordova framework. Let’s start with the basics first.
An Introduction – Apache Cordova
By building “Mobile Web” applications, you can create truly cross-platform compatible Apps that work in all major platforms – iOS, Android, Windows Phone.
- HTML5: App Mark-up
- CSS: App Styles
- JQuery & JQuery Mobile: App functionality
- Cordova: App build
Get your name right – Cordova or Phonegap?
Both names - Cordova, Phonegap – effectively correspond to the same framework so decide early on which name you want to use. You can dig out the history behind the name on Wikipedia. However a one line explanation is that “‘Adobe Corporation’ owned PhoneGap & decided to gift it to open source Apache Foundation. Apache named it Cordova & today looks after its well being”.
Personally, I use Cordova & I would recommend you do too if seriously looking to develop mobile applications in it.
How to setup Cordova?
Well, your first stop should be to go to Cordova documentation website. Follow the simple & clear instructions & you should be ready in no time.
You will need the following for setup. Install these as outlined on Cordova documentation & remember to check your path settings to ensure these are added. Try on Windows “Run --> cmd --> where java, where node, where ant or where android”.
- Java Development Kit
- Apache Ant
- SDKs of platforms you are targeting - iOS SDK & Android SDK
- Cordova setup using the npm
Check out the Cordova documentation, build & install the “HelloWorld” app on your phone to understand how different pieces fit together.
Remember you will need a MAC for developing iOS applications. You can’t use a Windows based system. Shame Apple won’t support that.
Build Projects - PhoneGap build vs Cordova CLI build
Adobe offers a cloud solution to build your Cordova projects called “PhoneGap Build”. You just upload your code & Adobe takes care of building & generating the deployable packages for iOS, Android, Windows Phone & Others.
Should you use it? NO.
PhoneGap build is for amateurs. If you are a serious developer then use the Cordova CLI utility to build your projects. It offers many flexibilities, main one is that you don’t have to upload your code to Adobe every time you make a small change to your app. Just run “cordova emulate android” & CLI will take care of preparing, building & running your code inside an emulator.
Is Cordova production ready?
It’s good for simple applications. If you are implementing complex solutions, then native is the way to go.