Skip Headers
Oracle® Fusion Middleware Mobile Client Developer's Guide for Oracle Application Development Framework
11g Release 1 (11.1.1.5.0)

Part Number E14826-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

1 Introduction to ADF Mobile Client

This chapter introduces ADF Mobile client—an Oracle JDeveloper extension for developing rich applications that run natively on mobile devices and smartphones.

This chapter includes the following sections:

1.1 Introduction to ADF Mobile Client

ADF Mobile client lets you develop high-performance mobile applications that do not require a browser and that provide full functionality even when disconnected from the server.

ADF Mobile client is built upon the ADF Mobile platform and lets you extend an existing Oracle Application Development Framework (Oracle ADF) application to create a new application that will run on any platform that ADF Mobile client supports (see Section 1.5.4, "Supported Devices and the Supported Database"). ADF Mobile client does the following:

ADF Mobile client applications use Oracle Database Lite Mobile Server and Oracle ADF Mobile transaction replay service to synchronize data between back-end business data sources and the mobile device or smartphone.

1.1.1 Understanding Differences Between ADF Mobile Client Applications and ADF Faces Web Applications

The operation of an ADF Mobile client application is substantially different from the operation of an ADF Faces Web application. ADF Faces applications adhere to the standard JSF lifecycle for processing an HTTP request and response. In Web applications, these lifecycle phases help define at various points in the processing of an HTTP request which actions are valid, which values are initialized, and so forth. It is also common for an HTML page to be discarded in the browser, with a completely new page then generated by the server and sent again to the browser (though this is changing with Web 2.0).

In contrast, ADF Mobile client implements an application model where the front end and back end reside on the same device. As it is inefficient to discard the UI every time a page transition occurs, or every time a value is submitted to the database, ADF Mobile client compresses the JSF lifecycle into a dynamic, always-on, event-driven model. This operating model is less like the traditional HTTP request-and-response model, and more like the Web 2.0 model, because a screen is created once and the user interface elements on it are updated dynamically based on the underlying data.

The ADF Mobile client consists of the following three basic layers:

  • ADF Business Components: This layer operates very similarly to the ADF Business Components layer in an ADF Faces application. You use the JDeveloper business component design time to create entity objects and view objects, apply view criteria for query customization, and so on. You can also generate Java classes for your entity and view objects and program against a subset of the oracle.jbo package.

  • ADF Model (JSR-227): This layer in ADF Mobile client is also very similar to ADF Faces: views are exposed through data controls; action bindings, method bindings, and iterator bindings are all available through the existing JDeveloper design time. However, it is this layer where some differences start to emerge. The current ADF Model layer is designed to support the JSF lifecycle among other things. Since the lifecycle does not exist in ADF Mobile client, some of the lifecycle-oriented constructs do not apply to ADF Mobile client applications.

  • UI: This layer of ADF Mobile client applications is new, but it retains a few key concepts from ADF Faces. ADF Mobile client pages are defined by MCX files, which are similar to JSPX files yet greatly simplified and abstracted in order to support cross-platform development. Many of the basic components that are present in ADF Faces, such as the Input Text, Output Text, and Select One Choice are included in the MCX format. In addition, the components are "wired" to the model layer with JSF Expression Language (EL). Understanding how EL expressions transfer data between the model and UI layers is key to understanding the difference between ADF Faces applications and ADF Mobile client applications.

    In an ADF Faces application, the server processes the JSPX file during the render response phase and replaces EL expressions with actual values. This works for ADF Faces because a new page can be generated and sent to the browser each time a value changes. With ADF Mobile client, however, a page is usually created just once. In order to provide data updates to the controls that are populated with EL expressions, EL event sources and sinks are created for every EL expression on a page. Whenever the underlying value of an EL expression changes, any event sinks for that expression will automatically receive the update. The events transfer data from the business component layer to the UI layer when a record iterator moves, and the events transfer data from the UI layer to the business component layer when a user updates a value on a form. For more information and examples, see Section 6.14.4, "EL Events."

1.2 Infrastructure Requirements for Developing ADF Mobile Client Applications

A number of physical and logical components are required when developing mobile applications using ADF Mobile client.

The main functional component areas of ADF Mobile client are the mobile client itself and the related synchronization technologies. On the server side, ADF Mobile client application data is processed in the same way that data from regular ADF applications is processed, ensuring data integrity and similarity of business processes.

Very simplistically, the ADF Mobile client infrastructure can be expressed, as shown in Figure 1-1.

Figure 1-1 ADF Mobile Client Infrastructure

ADF mobile client infrastructure

As the preceding illustration demonstrates, the synchronization technologies enable interactions between the existing ADF application (also known as the base application) including its database and the extended ADF Mobile client application.

For additional overview information on ADF Mobile client, see the following:

ADF Mobile client is compatible with Oracle ADF (see "Introduction to Oracle ADF" section in Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework). The mobile client shares most of the features and functionality of Oracle ADF by supporting many ADF components, such as view objects, Expression Language (EL), UI components, and so on. An ADF Mobile client application is always an extension of an existing ADF application. You apply your existing ADF development skills to develop mobile client applications.

For more information on what Oracle ADF shares with ADF Mobile client, see the following:

The synchronization technologies employed by ADF Mobile client may be hosted on the same server as the base ADF application. When connectivity is available, the data from the mobile client application's SQLite database can be synchronized with the base application's data.

For more information on synchronization, see Section 1.4, "Data and Transaction Synchronization."

When planning the development of a mobile client application, even though requirements vary depending on the platform for which you are developing, you generally need the following:

For more information on prerequisites, see Section 2.2, "Prerequisites for Developing ADF Mobile Client Applications."

1.3 Run-Time Architecture of ADF Mobile Client

ADF Mobile client consists of the following parts:

Note:

ADF Mobile client's model-view-controller stack resides on a mobile device or smartphone 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 JSR 227.

Figure 1-2 shows the ADF Mobile client architecture (in red) and how it fits into the overall ADF architecture.

Figure 1-2 ADF Mobile Client Run-Time Architecture Within ADF Architecture

ADF Mobile native client architecture

1.4 Data and Transaction Synchronization

Data integrity is the main goal of any data-processing application. Because ADF Mobile client enables functionality when the client is disconnected from the server and the main data source, it relies on synchronization technologies to preserve integrity of the application data. When data on the client is modified, a transaction is created to encapsulate those modifications. When connectivity becomes available, this transaction is recorded and replayed, triggering the update of data on the server.

Figure 1-3 shows how ADF Mobile client's run-time synchronization mechanism functions.

Figure 1-3 ADF Mobile Client Run-Time Synchronization

ADF Mobile native client RT data synchronization

Note:

The Entity Object Transaction Execution is supported by default in V1.

Note:

The transaction replay service can reside on the same application server as an ADF application.

1.4.1 Data Synchronization

ADF Mobile client provides local data storage on the mobile device or smartphone by synchronizing a subset of application data down to the device. This frees you from the need to provide the data synchronization code for your application.

The mobile client enables the table-level data synchronization from server to client through the use of Oracle Database Lite Mobile Server.

For more information, see the following:

1.4.2 Transaction Synchronization

Typically, server-side business logic cannot be duplicated or approximated on the client. To ensure data integrity, ADF Mobile client synchronizes device-side data transactions upstream via ADF Mobile transaction replay service. These transactions are then replayed through the ADF BC (Entity Object) layer of the base ADF application.

Basically, the transaction replay service enables the mobile client applications running on clients to access and execute business logic components on the server or on the base application. It can replay transactions against a variety of back-end services from ADF Business Component (BC) entity object operations, ADF BC view operations, ADF BC application modules operations and even other interfaces such as web services, Java classes and other elements that can be bound using JSR 227.

The transaction replay service is implemented using J2EE technologies and modeled on the Service Oriented Architecture (SOA). It is independent of the type of the disconnected client, synchronization technologies, application server, and database platform.

The transaction replay service infrastructure resides on the server side of the enterprise application and accepts transactions posted from one or more disconnected clients to a transaction replay service-specific database table. The transactions in this table are configured to map with available Java methods, and are subsequently posted (or replayed) to the enterprise application on behalf of the disconnected client. Using the mapped Java methods for transaction replay allows the implementation of complete server-side business logic for remotely collected data. Server-side business logic can include validation, deferred event triggers, and so on.

Disconnected client transactions that can be replayed using the transaction replay service are dependent on the type of application, as well as on your or your administrator's configurations. You can configure the transaction replay service for use with your disconnected solution (see Section 5.8.4, "How to Create a Transaction Replay Type"). Application administrators can monitor the transaction status and performance of the transaction replay service while in use with a disconnected solution.

The following are examples of transactions that can be replayed:

  • Creation of a new contact or account object record

  • Updates to existing records

1.5 Introduction to ADF Mobile Client Application Development

To ensure the best design for your ADF Mobile client application, Oracle recommends that you follow an iterative step-by-step development process.

ADF Mobile client offers you a declarative approach to application development through the use of drag-and-drop components, business logic wizards, and other productivity aids. This enables the following:

Note:

Even though the ADF Mobile client application is defined as XML with components expressed as XML tags, you have an option to customize it using Java code.

For more information, see Section 4.2, "About Developing an ADF Mobile Client Application."

1.5.1 Application Architecture

Your ADF Mobile client application will always extend an existing (base) ADF application:

  • Your entity objects will be copies of a subset of the entity objects of the base application.

  • Your view objects will either be based on entity objects, or they will be represented by static view objects.

For more information, see Section 5.2, "Extending an ADF Application to Mobile Client."

You use a wizard to generate your mobile client application's business components from the base ADF application's business components.

The following is a potential architecture for your ADF Mobile client application:

  • A database-bound, mostly disconnected application that consists of several views bound to data in tables stored in a local database on the device. Data is synchronized from a server database to the mobile device or smartphone. This data synchronization is the primary communication mechanism between the server application along with its data sources and the ADF Mobile client application. The application functionality is largely supported without the use of network connectivity.

For more information, see Chapter 5, "Developing the ADF Mobile Client Data Model."

1.5.2 Typical Development Stages

As with most application development, you perform the following activities when building your ADF Mobile client application:

  • Gather requirements

  • Design

  • Develop

  • Test

  • Deploy

A disconnectable mobile application is generally created as an extension of a server application. Although the mobile application should not mimic the server/desktop application in its presentation, its underlying data schema will mimic the server's data schema because it is a subset of that server schema.

It is assumed that you have a server-side database with an application schema already in place. The steps you take to build your ADF Mobile application will generally occur as follows:

  1. Design mobile tasks. Consider the tasks a mobile user will be performing, keeping in mind that handheld usage is different from that of a laptop or desktop machine. How will the mobile application help users get their jobs done? How will the users interact with the device? The more streamlined the application, the more they will use it. Can peripheral input devices be used (barcode scanners or cameras) to simplify processing? Design your mobile client application to be a genuine assistant to the mobile worker, not just a new data collection tool.

  2. Design a mobile data schema. The tasks you are bringing to the mobile application will have some server-side data representation, and likely they will have some server validation code as well. Use that information as a starting point for creation of your mobile application. Examine your server schema and identify the subset of tables and columns that will need to be available in the handheld application.

  3. Set up your work environment. Install the necessary applications and complete the required setup for development and deployment. For more information, see Chapter 2, "Setting Up the ADF Mobile Client Environment."

  4. Create your mobile client application using JDeveloper:

    • Build your mobile client business services (edit entity objects, create mobile views).

    • Develop mobile client task flows.

    • Design and refine the user interface.

    For more information, see Chapter 5, "Developing the ADF Mobile Client Data Model" and Chapter 6, "Creating the ADF Mobile Client User Interface."

  5. Deploy the application to a mobile device, smartphone, device emulator, or smartphone simulator:

    • Set up data synchronization.

    • Create database connections.

    • Set up the mobile device, smartphone, or simulator.

    • Synchronize the data.

    • Deploy the client runtime.

    • Deploy the mobile application.

    Note:

    With ADF Mobile client, it is required that you deploy to the mobile device, smartphone, device emulator, or smartphone simulator before doing any testing and debugging. A mobile client application cannot be run until you deploy it.

    For more information, see Chapter 8, "Deploying ADF Mobile Client Components."

  6. Test and debug the application:

    • Test synchronization.

    • Test and debug the application.

    • Optimize performance.

    For more information, see Chapter 10, "Testing and Debugging ADF Mobile Client Applications."

  7. Deploy the application to users.

    For more information, see the section about ADF Mobile client deployment in Oracle Fusion Middleware Administrator's Guide for Oracle Application Development Framework.

1.5.3 The Lifecycle of a View

Unlike ADF, the mobile client does not represent a lifecycle-driven system: once its view (page) is created, the flow of data from the UI to the model and back is immediate and continuous. In other words, a page is live as long as it is displayed, which makes Expression Language (EL) expressions live as well. For more information on EL, see Section 1.5.7, "Support for Expression Language."

For more information on ADF lifecycle, see "Understanding the Fusion Page Lifecycle" chapter of Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

For more information on the JSF extended lifecycle, see "Understanding the JSF and ADF Faces Lifecycles" chapter of Oracle Fusion Middleware Web User Interface Developer's Guide for Oracle Application Development Framework.

1.5.4 Supported Devices and the Supported Database

ADF Mobile client supports BlackBerry smartphones and Windows Mobile devices. The supported database for these devices is SQLite (see Section 1.5.4.1, "What You May Need to Know About SQLite").

1.5.4.1 What You May Need to Know About SQLite

SQLite is a relational database management system (RDBMS) specifically designed for embedded applications. SQLite databases are entirely self-contained in a single, portable file that is binary-compatible across a diverse range of computer architectures and operating systems.

SQLite has the following characteristics:

  • It is embedded.

  • It is ACID-compliant (atomicity, consistency, isolation, durability).

  • It is contained in a small library.

  • It is weakly-typed: any object can be stored in any column, regardless of how that column was declared.

  • It does not officially support foreign key constraints, although triggers can be used as a workaround.

  • It does not support RIGHT OUTER JOINs.

Your application can either call the SQLite library dynamically through function calls, or make it part of the application itself by creating a link to the library.

For more information, see http://www.sqlite.org

1.5.5 Supported ADF Components and Attributes

ADF Mobile client supports many ADF components and attributes. Refer to the following information, organized by layer:

Although ADF Mobile client is compatible with ADF, there is a number of differences in every layer that exist due to the inherent differences between a mobile application and a Web application.

1.5.6 Support for ADF View Objects

As stated in Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework, a view object is an Oracle ADF component that encapsulates an SQL query and simplifies working with its results.

View objects can access the database directly for read operations.

ADF Mobile client provides support for ADF view object functionality, with limited support for database field types.

Note:

With ADF Mobile client, you cannot create view objects that are based on SQL statements.

For more information, see the following:

1.5.7 Support for Expression Language

You use the Expression Language (EL) to enable data binding. For an overview of the use of EL with Oracle ADF, see "Using ADF Model in a Fusion Web Application" chapter in Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

ADF Mobile client supports the use of compound EL expressions. For more information, see Section 6.14, "Understanding EL Support."

ADF objects exist within different scopes, such as the application scope, session scope, page flow scope, and so on (see "About Object Scope Lifecycles" section in Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework). ADF Mobile client, however, only supports the application scope. EL expressions defined in the application scope namespace are available for the life of the application. With the mobile client, you can define an application scope on one view of an application, and then reference it on another.

For more information, see the following: