PhoneGap
Adobe’s PhoneGap platform enables a developer to create an app that runs on a variety of mobile devices. The developer accomplishes this largely by writing the user interface portion of their application with Web technologies such as HTML, CSS and JavaScript. PhoneGap’s development tools then bundle the HTML, CSS and JavaScript files into platform-specific deployment packages. PhoneGap supports a wide variety of platforms:
Who Developed PhoneGap ?
It is developed by Nitobi, a company based in Vancouver, Canada.
Nitobi was acquired by Adobe Corporation on the year of 2011.
After the acquisition Adobe released PhoneGap technology as open source under the name Apache Cordova.
How does Phonegap work?
PhoneGap is an application container that allows users to create natively applications using HTML, CSS, and JavaScript.
PhoneGap then produces a binary application archive to be distributed through the mobile app ecosystem.
Our mAPM functionality and our PhoneGap plugin ensure your mission critical hybrids run faster and better.
Requirements:
To build a simple PhoneGap app:
Architecture of PhoneGap
PhoneGap has a plugin-based architecture. Each device-specific feature is a plugin, which consists of javascript and native sides.
JavaScript side should be as cross-platform as possible, whereas native side can be implemented only once, for 1 device. Nevertheless built-in plugins are developed for all of the most popular platforms, so no need to reinvent the wheel.
This architecture, together with open source code, not only allows a developer to fix their bugs, but also allows them to tweak their plugins for as per requirements. Also, a developer can build his own plugin, and support any platform of his choice.
PhoneGap is not a “native application development” framework, even though it provides access through several device features using an abstraction layer, which otherwise are inaccessible to a normal webpage. In simple words, it provies a “WebView” with extended capabilities. Using PhoneGap we can access the following device features Like:-
- Android
- BlackBerry 5.x+
- iOS
- Windows 8
- Windows Phone 7 and 8
- WebOS
- Symbian
- Tizen..etc
Who Developed PhoneGap ?
It is developed by Nitobi, a company based in Vancouver, Canada.
Nitobi was acquired by Adobe Corporation on the year of 2011.
After the acquisition Adobe released PhoneGap technology as open source under the name Apache Cordova.
How does Phonegap work?
PhoneGap is an application container that allows users to create natively applications using HTML, CSS, and JavaScript.
PhoneGap then produces a binary application archive to be distributed through the mobile app ecosystem.
Our mAPM functionality and our PhoneGap plugin ensure your mission critical hybrids run faster and better.
Requirements:
- Cordova 3.3.0
- jQuery
To build a simple PhoneGap app:
- sudo npm install -g phonegap (if you don't have phonegap already have)
- phonegap create sample_app
- cd sample_app
- cordova platform add ios
- cordova platform add android
- cordova -d plugin
- cordova build
- jQuery $.getScript requests and requests with datatype ‘jsonp’ are not monitored
- Synchronous XMLHttpRequests and jQuery ajax calls are missing latency information
- Information on payload size is not currently collected when sending and receiving FormData and Document data types
- If you wish to add the android or ios platform after the plugin is installed you must remove and reinstall the plugin
Architecture of PhoneGap
PhoneGap has a plugin-based architecture. Each device-specific feature is a plugin, which consists of javascript and native sides.
JavaScript side should be as cross-platform as possible, whereas native side can be implemented only once, for 1 device. Nevertheless built-in plugins are developed for all of the most popular platforms, so no need to reinvent the wheel.
This architecture, together with open source code, not only allows a developer to fix their bugs, but also allows them to tweak their plugins for as per requirements. Also, a developer can build his own plugin, and support any platform of his choice.
PhoneGap is not a “native application development” framework, even though it provides access through several device features using an abstraction layer, which otherwise are inaccessible to a normal webpage. In simple words, it provies a “WebView” with extended capabilities. Using PhoneGap we can access the following device features Like:-
- Accelerometer
- Camera
- Compass
- Contacts
- Geolocation
- Media
- Network
- Notification
- Storage
- Filesystem etc.......
In the above diagram we can see that PhoneGap provides a “BrowserWebViews” which is nothing but a bare bone web browser without a Chrome UI. The native code in PhoneGap SDK exposes uniform APIs across multiple device platforms which are accessible to JavaScript running inside the WebView.
As a web App developer if you are using PhoneGap then it’s less likely that you’ll need to know the internals of the SDK.
Approach To Develop PhoneGap Apps.
Even though you’re Web Developer and you are using HTML/CSS/JavaScript to develop Web applications, remember that it’s not a traditional desktop browser environment and the user experience pattern is significantly different. The PhoneGap apps are downloadable from any App Store (Like_Google, Amazon, Apple ), so user might not know that your app is built using Xcode, J2me, PhoneGap or HTML/CSS, it’s always a good practice to be consistent with the platform UI guidelines so that you don’t confuse your users. A simple example could be if you’re developing a PhoneGap app for Android or iOS then be sure to handle the hardware/software(ICS) “back key”, if you don’t do that then your users might get confused because of this.
Another important factor is handling scaling and device orientation, you should always make sure that your app looks proper in both Portrait and Landscape orientations.
The recommended way to start PhoneGap development is below:
Advantages with PhoneGap!
PhoneGap is an excellent solution in a number of situations:
Multiple platforms: Since the front end of the application is built using web technologies, a PhoneGap application with the exact same source code can be deployed across different platforms.
Access basic native functionality: If the application requires minimal access to the native APIs such as camera, Geolocation and contacts PhoneGap allows access to these APIs with just a few lines of JavaScript code.
Offline usage: Although the app is built using web technologies, it can still provide offline functionality and has access to the browser’s local cache.
Disadvantages with PhoneGap!
Since the front end of the application is built in JavaScript, it causes a number of limitations.
Data processing: Native languages are much faster than JavaScript for data processing on the device.
Background processing: A large number of applications rely on background threads to provide a smooth user experience: calculating the GPS positions in the background, for example. PhoneGap APIs are built using JavaScript which is not multi-threaded and hence do not support background processing.
Access advanced native functionality: A number of native APIs are not yet supported by PhoneGap’s APIs.
Complex Business Logic: A number of applications such as enterprise applications are quite complex. In this scenario it is simply better to have a certain amount of native code.
Advanced Graphics: Apps that use advanced graphics which can only be accessed using third-party libraries are best done natively.
Security With PhoneGap
As your app runs inside WebView ( a browser), you should not allow untrusted third-party code to execute in the page, because this can compromize the security, the JS code downloaded from internet will suddenly have access to several device features that they can make substantial damage to user’s privacy and security. Do not load an iFrame in your app, or redirect to some other websites when the app is loaded, as this will likely get your app rejected in Apple app store, beacuse Apple does not like applications opening public websites inside the app as it makes it difficult or almost impossible to enforce policies regarding contents and all.
Resources To Build a PhoneGap App
Limitations of PhoneGap for Mobile Application
Phonegap is a cross platform for mobile application using webkit. Although it is very suitable to make multi platform application with unique code in javascript and CSS3 it has disadvantages
Why should mobile developers consider phonegap?
Mobile developers use PhoneGap because it allows them to have a common codebase for all their application code. It doesn’t force developers to reinvent the wheel every time they move from platform to platform.
How does phoneGap simplifies mobile development?
Building applications for each device--iPhone, Android, Windows Mobile and more--requires different frameworks and languages.
One day, the big players in mobile may decide to work together and unify third-party app development processes.
Until then, PhoneGap will use 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
What is the difference between PhoneGap and Cordova?.
PhoneGap was donated to the Apache Software Foundation (ASF) under the name Apache Cordova. Through the ASF, future PhoneGap development will ensure open stewardship of the project. It will remain free and open source under the Apache License, Version 2.0.
PhoneGap is an open source distribution of Cordova. Think about Cordova’s relationship to PhoneGap like WebKit’s relationship to Safari or Chrome.
What is PhoneGap Build, and how is it different from PhoneGap framework?
PhoneGap is a mobile application development framework, based upon the open source Apache Cordova project.It allows you to write an app once with HTML, CSS and JavaScript, and then deploy it to a wide range of mobile devices without losing the features of a native app.
PhoneGap Build is a cloud-based service built on top of the PhoneGap framework.
It allows you to easily build those same mobile apps in the cloud. Learn more about PhoneGap Build and try it out for free!
What is a hybrid app?
A hybrid application is one that has features of both a web application and a native application. Certain features, such as Image Capture, NFC or Android OpenAccessory, may be implemented natively since there is currently no way to do this in JavaScript. But the application logic and the UI are implemented using web technologies to allow for a consistent and unique user experience across devices.
what are the PhoneGap events ?
The phone gap events are listed below
Can you use PHP/ASP/JSF/Java/.NET with PhoneGap?
A PhoneGap application may only use HTML, CSS, and JavaScript. However, you can make use of network protocols (XmlHTTPRequest, Web Sockets, etc) to easily communicate with backend services written in any language. This allows your PhoneGap app to remotely access existing business processes while the device is connected to the Internet.
As a web App developer if you are using PhoneGap then it’s less likely that you’ll need to know the internals of the SDK.
Approach To Develop PhoneGap Apps.
Even though you’re Web Developer and you are using HTML/CSS/JavaScript to develop Web applications, remember that it’s not a traditional desktop browser environment and the user experience pattern is significantly different. The PhoneGap apps are downloadable from any App Store (Like_Google, Amazon, Apple ), so user might not know that your app is built using Xcode, J2me, PhoneGap or HTML/CSS, it’s always a good practice to be consistent with the platform UI guidelines so that you don’t confuse your users. A simple example could be if you’re developing a PhoneGap app for Android or iOS then be sure to handle the hardware/software(ICS) “back key”, if you don’t do that then your users might get confused because of this.
Another important factor is handling scaling and device orientation, you should always make sure that your app looks proper in both Portrait and Landscape orientations.
The recommended way to start PhoneGap development is below:
- Set-up environment for the target mobile platform for example Android/iOS etc, To know more http://phonegap.com/developer/
- Run the sample app provided with the PhoneGap SDK.
- Check API Documentation properly. Click here to know more http://docs.phonegap.com/
- Try creating PhoneGap sample apps of your own using each of the device features available through the PhoneGap API.
- Once you are familiar with PhoneGap, try creating a sample app which uses multiple device APIs, using jQuery Mobile, Sencha, Jo HTML5 Mobile App or jQTouch) to build the Phone like user interface.
Advantages with PhoneGap!
PhoneGap is an excellent solution in a number of situations:
Multiple platforms: Since the front end of the application is built using web technologies, a PhoneGap application with the exact same source code can be deployed across different platforms.
Access basic native functionality: If the application requires minimal access to the native APIs such as camera, Geolocation and contacts PhoneGap allows access to these APIs with just a few lines of JavaScript code.
Offline usage: Although the app is built using web technologies, it can still provide offline functionality and has access to the browser’s local cache.
Disadvantages with PhoneGap!
Since the front end of the application is built in JavaScript, it causes a number of limitations.
Data processing: Native languages are much faster than JavaScript for data processing on the device.
Background processing: A large number of applications rely on background threads to provide a smooth user experience: calculating the GPS positions in the background, for example. PhoneGap APIs are built using JavaScript which is not multi-threaded and hence do not support background processing.
Access advanced native functionality: A number of native APIs are not yet supported by PhoneGap’s APIs.
Complex Business Logic: A number of applications such as enterprise applications are quite complex. In this scenario it is simply better to have a certain amount of native code.
Advanced Graphics: Apps that use advanced graphics which can only be accessed using third-party libraries are best done natively.
Security With PhoneGap
As your app runs inside WebView ( a browser), you should not allow untrusted third-party code to execute in the page, because this can compromize the security, the JS code downloaded from internet will suddenly have access to several device features that they can make substantial damage to user’s privacy and security. Do not load an iFrame in your app, or redirect to some other websites when the app is loaded, as this will likely get your app rejected in Apple app store, beacuse Apple does not like applications opening public websites inside the app as it makes it difficult or almost impossible to enforce policies regarding contents and all.
Resources To Build a PhoneGap App
- jQuery Mobile
- jQTouch
- Jo HTML5 App Framework
- Wink Toolkit
- Sencha Touch – Commercial
- The M-Project
- AppMobi
- DHTMLX Touch
- NimbleKit – iOS only Commercial
- Backbone.JS – JavaScript MVC framework
- Zepto.js – JavaScript library for Webkit browsers
Limitations of PhoneGap for Mobile Application
Phonegap is a cross platform for mobile application using webkit. Although it is very suitable to make multi platform application with unique code in javascript and CSS3 it has disadvantages
- Difficult to debug scripts
- Many limitation from the webkit
- Since it is using webkit application behaviour different from each operating system
- Bad performance
- Long application launch time
Why should mobile developers consider phonegap?
Mobile developers use PhoneGap because it allows them to have a common codebase for all their application code. It doesn’t force developers to reinvent the wheel every time they move from platform to platform.
How does phoneGap simplifies mobile development?
Building applications for each device--iPhone, Android, Windows Mobile and more--requires different frameworks and languages.
One day, the big players in mobile may decide to work together and unify third-party app development processes.
Until then, PhoneGap will use 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
What is the difference between PhoneGap and Cordova?.
PhoneGap was donated to the Apache Software Foundation (ASF) under the name Apache Cordova. Through the ASF, future PhoneGap development will ensure open stewardship of the project. It will remain free and open source under the Apache License, Version 2.0.
PhoneGap is an open source distribution of Cordova. Think about Cordova’s relationship to PhoneGap like WebKit’s relationship to Safari or Chrome.
What is PhoneGap Build, and how is it different from PhoneGap framework?
PhoneGap is a mobile application development framework, based upon the open source Apache Cordova project.It allows you to write an app once with HTML, CSS and JavaScript, and then deploy it to a wide range of mobile devices without losing the features of a native app.
PhoneGap Build is a cloud-based service built on top of the PhoneGap framework.
It allows you to easily build those same mobile apps in the cloud. Learn more about PhoneGap Build and try it out for free!
What is a hybrid app?
A hybrid application is one that has features of both a web application and a native application. Certain features, such as Image Capture, NFC or Android OpenAccessory, may be implemented natively since there is currently no way to do this in JavaScript. But the application logic and the UI are implemented using web technologies to allow for a consistent and unique user experience across devices.
what are the PhoneGap events ?
The phone gap events are listed below
- deviceready
- pause
- resume
- online
- offline
- backbutton
- batterycritical
- batterylow
- batterystatus
- menubutton
- searchbutton
- startcallbutton
- endcallbutton
- volumedownbutton
- volumeupbutton
Can you use PHP/ASP/JSF/Java/.NET with PhoneGap?
A PhoneGap application may only use HTML, CSS, and JavaScript. However, you can make use of network protocols (XmlHTTPRequest, Web Sockets, etc) to easily communicate with backend services written in any language. This allows your PhoneGap app to remotely access existing business processes while the device is connected to the Internet.
|