Choosing Cordova Client Frameworks

The JavaScript framework choices are similar between a Cordova app and a website. These choices are split between frameworks that help you build a better user experience and those that define application framework structure. The following discusses each group of frameworks:

Image User experience (UX) frameworks—Bootstrap is often used to provide better-looking and responsive UIs on Cordova. Web developers are comfortable using it and often leverage it for mobile web development. However, earlier versions of Bootstrap were seen as too heavy and slow for mobile. Later versions have made great improvements.

Ionic is a mobile-first UI framework. It is typically not used by websites but often has become the popular framework for building mobile apps on Cordova. It provides a more native user experience on a device. It includes UI elements and “formulas” for tackling common design problems. Ionic also relies on AngularJS for UI logic such as loading pages, data binding, gestures, animations, and other user interactions. Ionic + AngularJS has become a popular set of frameworks for building Cordova apps. (We look at using this approach later in this chapter.)

There are other great UX frameworks out there, such as jQuery mobile and Sencha Touch. Nearly all of them provide great components based on HTML5 and user interaction with JavaScript.

Image Application frameworks—The frameworks are created to help manage how your pages load, events fire, and data is bound. They are often referred to as SPA (single-page application) frameworks. Popular application frameworks for Cordova include these:

Image AngularJS provides an MVC pattern on the client. It supports two-way data binding and page loading through a routing engine. See Chapter 18 for more details on building with AngularJS.

Image Backbone is another MVC, client-side framework. It, too, supports databinding and custom events. Learn more at backbonejs.org.

Image WinJS is an open-source project from Microsoft that eases building JavaScript client-side apps. It combines both UI controls and an application framework. You can use it to build Cordova apps, websites, and Windows native applications. You can learn more at http://try.buildwinjs.com/#get.

All the frameworks mentioned here are open source. However, there are also commercial options available. Of course, you are not limited to any specific framework and may combine more than one for your solution. This chapter explores building a Cordova app with AngularJS and Ionic.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset