PhoneGap / Cordova
1) What is PhoneGap/Cordova?
- Let’s Just say(PG) PhoneGap, for now, PG and Cordova are the same things!
- A PhoneGap Application is a Web Application. you can write it with any code editor and you can use any framework.
- PG allows us to convert an HTML, CSS, and Javascript site into a Native Mobile App.
- As a Native App, PG gives us tools to access device features that a web browser. Does not have access to.
- PhoneGap is a native application for various mobile phone platform with HTML, javascript, and CSS.
- PhoneGap is free to download from PhoneGap.com.
- PhoneGap runs on ILS devices, iPhone, iPad. It also runs on Android, BlackBerry, WebOS, Symbian, windows and there’s lots more platform on the way.
- There are tons of companies, Big and small using PhoneGap.
2) A Simple “Hello World” Example
We Just have to add a couple things to get started with PG.
- Device Ready
- You can use config.xml to configure your app in a platform independent way.
- phonegap.js
3) PhoneGap Build- You can compile these apps locally using Xcode, Eclipse, and the native SDK for each platform. But there is also an easier way ‘PhoneGap Build’
- PhoneGap Build compiles and packages your mobile app in the cloud.
- PhoneGap Build is used to build app for 6 mobile platforms.
- You can upload your app to PhoneGap Build using a Zip file.
- PhoneGap build is a cloud-based service that lets you compile and do a lot of development with PhoneGap. You upload it to our servers where we actually do the build process for you.
- We have to follow below simple steps.
a) STEP1 –
Upload the app.
b) STEP2 –
Build For 6 mobile platforms.
For iOS, you need a developers certificate and an application provisioning profile.
c) STEP3-
Install the app.Either download the individual files or install the app on your device using a QR code reader.
For iOS, you need a developers certificate and an application provisioning profile.
Github integration
- Instead of uploading a ZIP file, you can point to a Github repository.4)Plugins
- PhoneGap Build can support PhoneGap plugins.
- For this, you will have to download APK file and installed. When we add some plugins the size of application will increase.
- Under the plugins section of google docs, you can see that we can add plugins using NPM. (npmis the node package manager and installed with node.js. and npm command fetches the necessary dependencies for the PhoneGap CLI to run on your local machine.)
- There are two kinds of tags that you can use one is “simple plug-in tag” and the second one is gap: plug ins.
- Cordova plugins support more operating systems.
- Most of the time the plugins will have the documentation and that you need for PhoneGap build.
- PhoneGap can support plugins like Battery, camera, contacts, Accelerometer, social.