Cordova – PhoneGap development part 1

PhoneGap is an open source framework that allows you to create natively-installed applications for mobile devices using HTML, CSS, and JavaScript. Building applications for each device–iPhone, Android, Windows Mobile and more–requires different frameworks and languages. PhoneGap solves this by using standards-based web technologies to bridge web applications and mobile devices. Since PhoneGap apps are standards compliant, they’re future-proofed to work with browsers as they evolve. PhoneGap is a set of project templates for different mobile operating systems, allowing us to ignore the details of each SDK and develop applications in a consistent fashion.

In 2011, the PhoneGap codebase moved to an open source Apache Software Foundation project under the name Cordova. Adobe still distributes the library under the PhoneGap name. Although both of the project names are referenced in this publication, it is by design and not meant to cause confusion. Essentially, both the PhoneGap and Cordova projects are the same, and refer to the same free, open source library.

The user interface for PhoneGap applications is created using HTML, CSS, and JavaScript. The UI layer of a PhoneGap application is a web browser view that takes up 100% of the device width and 100% of the device height. The web view used by PhoneGap is the same web view used by the native operating system. On iOS, this is the Objective-C UIWebView class; on Android, this is android.webkit.WebView.

PhoneGap provides an application programming interface (API) that enables you to access native operating system functionality using JavaScript. You build your application logic using JavaScript, and the PhoneGap API handles communication with the native operating system. The final product of a PhoneGap application is a binary application archive that can be distributed through standard application ecosystems.

The PhoneGap application acts as a client for the user to interact with. The PhoneGap client communicates with an application server to receive data. The application server handles business logic and communicates with a back-end data repository. The client to application server communication can be based upon standard HTTP requests for HTML content, REST-ful XML services, JSON services, or SOAP (or websockets if your OS supports it). These are the exact same techniques that you would use in a desktop-browser based AJAX) application. In detail, for each PhoneGap platform:

  • You can develop Android and HP webOS apps on any of the major desktop operating systems like Windows, Mac OS X, or Linux
  • You can develop Symbian Web Runtime apps on any OS, but you can only run the simulator from Windows
  • Developing for BlackBerry is similar, the SDK can be installed on Windows or Mac OS X, but, at the time of writing, the simulator only runs on Windows
  • The iOS SDK requires the latest version, 10.6, of Mac OS X
Build diagram
Build diagram

Leave a Reply