Mobile frameworks, toolkits, and libraries
JavaScript is an implementation of the ECMAScript language open standard. The JavaScript community is worldwide and very active. JavaScript is one of the most widely used languages. Today, there are a plethora of tools that are provided by this community that help JavaScript development. These tools go under different names: toolkits, libraries, modules, and frameworks.
Note
JavaScript frameworks, toolkits, and libraries help to simplify mobile web development.
Often the terms library and framework are used interchangeably. There is a subtle but distinct difference between a library and framework called the inversion of control. When a developer's code calls a library, the code is in control. The reverse is true for a framework. Here, the framework calls the developer's code. More simply put, a library is a collection of functionality that you can call, whereas a framework provides automatic flow controls. For all intents and purposes, libraries and toolkits are identical.
In later chapters, both frameworks and libraries will be discussed in more detail. The code examples provided in the code bundle will be built using the Dojo framework, this is the base for the ArcGIS JavaScript API. Dojo helps developers to build dynamic web interfaces.
Note
An alternative to Dojo is jQuery mobile.
There are two other frameworks that are worth mentioning and will form the base for later chapters. These are Bootstrap and PhoneGap.
Bootstrap
Bootstrap is the most popular framework for developing responsive mobile applications. This framework provides automatic layout adaptation. That includes adapting to changes in device orientation and screen size. This means your ArcGIS web application will look good and be usable on all mobile devices: smartphones, phablets, and tablets.
The following screenshot shows Bootstrap downloads, illustrating its popularity:
PhoneGap
PhoneGap is a framework that allows developers to convert web mobile applications into installable hybrid apps.
Note
Cordova is an open source framework that is managed by the Apache Foundation. PhoneGap is based on Cordova and PhoneGap is owned and managed by Adobe.
For more information, visit http://cordova.apache.org/.
The names (Cordova and PhoneGap) are often used interchangeably; in fact, the two are very similar, but there is a legal and technical difference.
These hybrid apps can be distributed through the various mobile app stores, just like their native counterparts. In Chapter 7, Developing Hybrid ArcGIS Mobile Applications with PhoneGap we will walk you through the development of a hybrid ArcGIS mobile app. PhoneGap works by providing a web app with a native wrapper around a headless browser. These wrappers are platform-specific and allow your web app to be built to run natively on any of the popular mobile platforms.
The following screenshot illustrates how to convert a web app to hybrid using PhoneGap: