This article provides basic information about hybrid applications for mobile operating systems, using the Android operating system as an example. The main advantages and disadvantages, common features and differences of embedded and hybrid mobile applications, and the necessary elements of hybrid applications are considered.
Laptop, tablet computer, e-book, and smartphone – this is just an incomplete list of mobile devices that people use every day for work, study, communication, and recreation. However, these devices are usually controlled by their own separate operating system (OS) (iOS, Android, Windows Phone, BlackBerry, etc.). This creates certain inconveniences for the exchange of information between them through built-in applications.
To create an embedded mobile application for any OS, you need to study the programming language, as well as the SDK – software development kit – a specialized development package that takes into account the features of a particular mobile operating system. For example, to create an embedded mobile application for the Android operating system, you need to know the Java programming language and the Android SDK package. This condition imposes certain restrictions on developers who have to choose a certain direction for work.
These two technologies have their advantages and disadvantages. Embedded applications are loaded once from the public application storage and, in the future, do not require an Internet connection, but, on the other hand, as mentioned above, the process of creating embedded applications for different mobile operating systems is a complex and time-consuming business. Web applications are cross-platform and require only a web browser and an Internet connection. On the other hand, such applications have significantly limited access to the internal resources of the device.
Hybrid mobile applications are a kind of solution. To create them, you need minimal knowledge of built-in mobile applications IOS and Android, as well as knowledge of web technologies. Hybrid applications, like web applications, are programmed using web technologies but are packaged as embedded applications. These mobile apps are distributed through public app stores, just like built-in ones. Unlike web applications, they have direct access to the resources of a mobile device, which makes them more functional.
In addition, the basic functionality of Phone Gap can be extended by using additional plugins from a special repository. At the moment there is a set of plugins for four operating systems: iOS, Android, BlackBerry, and Palm.
In addition to the platform itself for mobile applications, Phone Gap provides access to its “cloud”, where you can build a project and download an executable file to your mobile device. To access the cloud, you need to register on the official Phone Gap Build website, and after that, the online program builder will become available. The advantage of this service is its general availability and a large library of other users’ developments with open source. On the other hand, this advantage is also a disadvantage. The fact is that only open source applications are available in the free version of the service, i.e. after building, your application code is published in the application library and becomes available to other developers as an open-source project. Building closed-source applications is available only in the paid version of the service.
Portions of the Dojo package can be used to add various interactivity to a site:
- Menus, bookmarks, tooltips
- Selectors of date, time, hours
- Sortable tables, dynamic charts, vector 2D graphics
- Elements of the “tree” interface, with drag-and-drop capabilities (nested sets, nested sets)
- Rich Text Editor
- Animated effects, and build your own
Therefore, Phone Gap adapts the site for a mobile device and makes it look like an embedded application using Dojo-interface elements, so the main element of the embedded part of an Android application will be Web view, that is, an embedded web browser in a simple mobile application. To create hybrid applications, an embedded part of it, developers of the Android mobile OS recommend using the Eclipse development environment.
As well as for a regular built-in application, for a hybrid one the standard Android Application project is used, in which, as an addition, the PhoneGap.jar library and a set of Dojo-scripts are included in the project as js-files as needed.
The difference from the standard project is the use of the loader () method in the main App.java file, which, in principle, makes the embedded application part of the hybrid, i.e. when the application starts, the web service is loaded, not the built-in Activity.
When developing hybrid applications, you first need to create a simple web application using web technologies, thoroughly debug and test it in a browser on a computer and then start adapting it for mobile devices by creating an embedded part of the application.