1 Introduction to ADF Mobile

This chapter introduces Oracle ADF Mobile—a metadata-based application development framework within Oracle JDeveloper that enables you to create multi-featured applications for Apple iOS and Google Android-powered devices from a single source using the declarative development approach. The applications run natively on the mobile devices.

This chapter includes the following sections:

1.1 Introduction to ADF Mobile

From a single code base, using the standard HTML5, CSS, and Java technology, ADF Mobile enables you to create and extend an application that can house different types of content packaged for either iOS or Android platform.

Within the application, the contained functional areas are referred to as application features and represent one or more specific pieces of the application's functionality.

The following types of application features can coexist within the same ADF Mobile application:

  • ADF Mobile AMX—although you do not necessarily have to develop the application features that reside within the ADF Mobile application, this implementation approach allows you to define an application feature which utilizes much of the device's functionality through embedded components, with the metadata represented by an XML file. This application feature implementation, which is generated into HTML or JavaScript on a mobile device and which uses ADF data bindings, is developed declaratively in JDeveloper using a set of ADF Mobile-specific components.

    The workflows of ADF Mobile AMX pages are portable across platforms.

    Figure 1-1 shows the user interface rendered for an application feature implemented using ADF Mobile AMX.

    Figure 1-1 UI Rendered for ADF Mobile AMX Application Feature

    UI Rendered for ADF Mobile AMX

    For more information, see the following:

  • Local HTML—this implementation approach allows you to employ an HTML file that might embed existing technologies, such as JavaScript and Java. You can use JDeveloper to implement an ADF Mobile application feature as a local HTML. For more information, see Section 5.10.1, "How to Define the Application Content."

  • Remote URL (also known as server HTML)—this implementation approach allows you to point to a resource on the web by specifying a URL endpoint. You can use JDeveloper to implement an ADF Mobile application feature as a remote URL.

    The URL endpoints are portable across platforms.

    Figure 1-2 shows the user interface rendered for an application feature implemented using remote URL.

    Figure 1-2 UI Rendered for Remote URL Application Feature

    UI Rendered for Remote URL

    For more information, see the following:.

An ADF Mobile application enables the integration of its embedded application features with such native device services as phone, camera, GPS, contacts, and so on. In addition, ADF Mobile enables support for offline application use. The device services can be accessed from the local HTML, ADF Mobile AMX, Java, and remote web applications. This allows the end user to perform such tasks as place a call from the mobile device by clicking a name listed in the contacts for an application feature for a mobile field service report form or scan a receipt to update a mobile expense report. For more information on ADF Mobile user experience, see Appendix D, "ADF Mobile Application Usage."

Although each ADF Mobile application feature may have its own set of preferences defined by the end user, ADF Mobile enables you to apply a uniform style of preferences to each of the application features embedded into the ADF Mobile application. Further, you can improve the end-user experience by grouping these mobile application features by functionality. For example, you can group a mobile application feature that provides customer contacts together with one for product inventory into the same ADF Mobile application. You can also control the display of the application features by such criteria as user role or device version.

From the end-user perspective, an application built with ADF Mobile is launched by activating its application icon on the mobile device, as Figure 1-3 shows. For more information, see Appendix D, "ADF Mobile Application Usage."

Figure 1-3 Launching ADF Mobile Application

Launching ADF Mobile Application

After the ADF Mobile application opens, the end user activates an icon for an application feature. The application features can display as icons on a navigation bar (see the bottom portion of Figure 1-4) or in a page format with larger icons in a homescreen page, commonly referred to as a springboard (see Figure 1-5).

Figure 1-4 Application Features Displayed on Navigation Bar

Application Features Displayed on Navigation Bar

Figure 1-5 Application Features Displayed on Springboard

Application Features Displayed on Springboard

1.2 ADF Mobile Runtime Architecture

Based on a hybrid mobile architecture and being an extension of Apache Cordova (see http://cordova.apache.org), ADF Mobile enables HTML5, as well as ADF-defined pages and task flows to be rendered in the same downloadable application.

ADF Mobile consists of the following parts:

  • Model provided by Oracle ADF.

    Note:

    The model layer provides the facility to connect to a local database.

  • View expressed as HTML or XML.

  • Controller defined with XML.

  • Java runtime powered by an embedded Java VM bundled with each application.

Note:

ADF Mobile's model-view-controller stack resides on a mobile device and represents reimplementation of ADF's model-view-controller layers. UI metadata is rendered to native components on device and is bound to the model through the ADF Model.

For additional information, see Section 2.9, "Comparison of ADF Mobile and Server-Based Oracle ADF."

Figure 1-6 shows the overall runtime architecture of ADF Mobile.

Figure 1-6 ADF Mobile Runtime Architecture

Run-Time Architecture of ADF Mobile

As shown in Figure 1-6, the following elements comprise the ADF Mobile runtime architecture:

  • Device-Native Container represents an application container, or template, compiled as a device-native application binary. This container provides the runtime environment for an ADF Mobile application to run as an on-device, native application in the mobile device's operating system (for example, iOS). Besides hosting the client-side components for an ADF Mobile application, it provides navigation utilities, such as a springboard and navigation bar, which enable access to particular application features.

  • Web View is a part of the device native container that uses a mobile device's web engine to display and process web-based content. In an ADF Mobile application, the web view is the primary mechanism to render and deliver the application user interface.

  • Server HTML represents a web-based user interface that is generated on the server and delivered as a web page to the ADF Mobile application. The application HTML code, business logic, and page flow logic are generated on a remote server. Server HTML can access device native services, such as the camera, through the JavaScript API supported by Cordova, as long as it is running inside an ADF Mobile application. Common options for server HTML-based pages are ADF Mobile browser and Oracle ADF Faces rich client-based pages. For more information, see Chapter 12, "Implementing Application Features as Remote URLs."

  • Local HTML represents web pages developed using JDeveloper or third-party tools that are directly embedded within an ADF Mobile application. These pages are delivered as a part of the ADF Mobile application. Local HTML files can access device native features through the JavaScript APIs supported by Cordova.

  • ADF Controller is represented by a mobile version of the Oracle ADF controller that supports a subset of Oracle ADF task flow components available to a server-based Oracle ADF application. Both bounded and unbounded Oracle ADF task flows are supported, as well as a subset of events and scopes that are supported by the server-based ADF. For more information, see Section 6.2, "Creating Task Flows."

  • ADF Mobile AMX Views are based on the ADF Mobile AMX technology that delivers a JSF-like development experience to working with an HTML5-based user interface. ADF Mobile AMX views are defined using UI and code editors provided by JDeveloper. These views are embedded into an ADF Mobile application and deployed to a mobile device. At run time, the JavaScript engine in the web view renders ADF Mobile AMX view definitions into HTML5 components. Of the implementation approaches provided by ADF Mobile, application features developed using the ADF Mobile AMX components provide the most authentic device-native user experience through their extensive support of animation and gestures. For more information, see Part IV, "Creating the ADF Mobile AMX Application Feature".

  • Java provides a Java runtime environment for an ADF Mobile application. This Java Virtual Machine (JVM) is implemented in device-native code, and is embedded (or compiled) into each instance of the ADF Mobile application as part of the native application binary. The JVM is based on the JavaME Connected Device Configuration (CDC) specification.

  • Managed Beans are Java classes that can be created to extend the capabilities of ADF Mobile, such as providing additional business logic for processing data returned from the server. Managed beans are executed by the embedded Java support, and therefore must conform to the JavaME CDC specifications. For more information, see Chapter 8, "Using Bindings and Creating Data Controls."

  • ADF Model in an ADF Mobile application supports a subset of business logic components available to a server-based Oracle ADF application. ADF model contains the binding layer that connects the business logic components with the user interface. In addition, the binding layer provides the execution logic to invoke REST or SOAP-based web services. For more information, see Chapter 8, "Using Bindings and Creating Data Controls."

  • Application Configuration refers to services that allow key application configurations to be downloaded and refreshed. For example, URL endpoints for a web service or remote URL connection. Application configuration services download the configuration information from a WebDav-based server-side service. For more information, see Chapter 10, "Administering Web Services."

  • Credential Management and Access Control refers to client-side services that provide security-related services for an ADF Mobile application. For example, a local credential store that securely caches user credentials to support an offline authentication or access control services that display or hide application features based on user access privileges. For more information, see Chapter 18, "ADF Mobile Application Security."

  • Apache Cordova (formerly known as PhoneGap) is an open-source code library that provides a common JavaScript API to access various mobile device services, such as the camera. Cordova provides a majority of the device services integration for an ADF Mobile application. Cordova JavaScript APIs are further abstracted as device data controls in the JDeveloper design time for ADF Mobile AMX-based views, allowing for integration of device services by dragging and dropping data controls to their ADF Mobile AMX views.

  • Local Data refers to data stores that reside on the device. In ADF Mobile, these are implemented as encrypted SQLite databases. Create Retrieve Update Delete (CRUD) operations are supported to this local data store through the Java layer, using JDBC-based APIs. For more information, see Chapter 11, "Using the Local Database."

  • On the server side, the ADF Mobile Browser refers to a framework for developing server-side applications that can be used for implementation of the remote URL ADF Mobile application feature. For more information, see Chapter 12, "Implementing Application Features as Remote URLs."

  • On the server side, the Configuration Server refers to a WebDav-based server that hosts configuration files used by the application configuration services. The configuration server is delivered as a reference implementation. Any common WebDav services hosted on a common JEE server can be used for this purpose. For more information, see Chapter 10, "Administering Web Services."