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

4 Getting Started with ADF Mobile Client

This chapter describes how to use JDeveloper to declaratively create ADF Mobile client applications.

This chapter includes the following sections:

4.1 About Declarative Development with JDeveloper

You can write, deploy, and test an ADF Mobile client application without writing a line of code because the JDeveloper design experience is enhanced to include support of mobile client application development. JDeveloper provides a series of wizards that step you through creating the mobile client application, creating its model and view projects, and creating business objects. In addition, it generates the required artifacts to define page flows. You can then define the views of the project using the drag and drop functionality of the Data Controls panel and the Component Palette.

4.2 About Developing an ADF Mobile Client Application

To develop an ADF Mobile client application:

  1. Determine the mobile data requirements: While mobile client applications are extensions of ADF applications that run on a server, users will not use the handheld version of this application in the same way as they would use it on a desktop. Because mobile applications should not mimic their server-side counterparts in terms of presentation or user interaction, consider the tasks that users perform with the mobile application and the circumstances under which they use the mobile application. For example, would the user interact with the mobile application for minutes, as opposed to hours, as they would on a desktop application?

    Tip:

    To encourage usage, streamline the application as much as possible. For example, consider peripherals, such as barcode readers, cameras, or scanners.
  2. Create a subset of the server data model for the ADF Mobile client application: Although the mobile applications themselves are not merely handheld copies of server-side applications, the underlying data that they manipulate is a subset of server data. Because the tasks enabled by a mobile client application have server-side data representation as well as server-side validation, begin creating a subset of the data by examining the server data model and identify a subset of those entity objects that should be available to the mobile client application. As described in Section 4.5, "Extending the Base Application for the Mobile Client Application," you use the Create Business Components for ADF Mobile Client wizard to identify the tables from the base application from which you want to create entity objects and the columns that you want to expose. This wizard also enables you to create view objects. For more information, see Section 5.2.1, "How to Create Subsets of Entity Objects and View Objects." For more information on entity objects and view objects, see Section 5.1.1, "Support for the Core ADF Business Components."

  3. Edit the entity objects as needed: If needed, you can expose additional attributes to the user interface or change certain properties of the attributes that already belong to entity objects. For more information, see Section 5.3, "Editing Mobile Entity Objects."

  4. Test the mobile data model by running the mobile Application Module with the Business Component Browser. For more information, see "Using the Business Component Browser for Testing and Debugging" in Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

  5. Create or configure custom ADF Mobile transaction replay items.

  6. Define the mobile client task flow: You begin designing the UI of the mobile application by creating an overall page flow and then by populating the task flow with views (pages) and control rules.

  7. Create the mobile client views: After you create the task flow, you can create the UI by populating the pages with ADF components and data controls. ADF Mobile client supports components for page layout, input and output mechanisms, image display, and page navigation. For more information, see Chapter 6, "Creating the ADF Mobile Client User Interface."

  8. Define menus: ADF Mobile client enables you to create platform-specific menus for both BlackBerry smartphones and Windows Mobile devices. For more information, see Section 6.11, "Creating and Using Menus."

4.3 Deploying the Model Project of the Base Application as an ADF Library

Once you have created (or located) an ADF application on which to base the mobile client application, you then deploy its model project as an ADF library as described in "Packaging a Reusable ADF Component into an ADF Library" in Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework. You draw from this library using the Business Components from ADF Library wizard to create the subsets of entity objects and view objects used by the ADF Mobile application. For more information, see Section 5.2, "Extending an ADF Application to Mobile Client."

4.3.1 How to Deploy the Model Project

You create the ADF Library for the mobile application by packaging the model project of the base application as a JAR file.

Before you begin:

Obtain a JAR file that contains the ADF library that will be used to create the business components for the ADF Mobile application or create an application that contains these business components using the Create Business Components from Tables Wizard as described in "Creating a Business Domain Layer Using Entity Objects" in Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

To Deploy the model project as a JAR file:

  1. In the Application Navigator, right click the model project.

  2. In the Project Properties dialog's left pane, select Deployment and then click New.

  3. In the Create Deployment Profile dialog, select ADF Library JAR file for archive type, enter a name for the deployment profile, and click OK.

  4. Verify the default directory path or enter a new path to store your ADF Library JAR file. Click OK.

  5. In the Application Navigator, right-click the model project and choose Deployment.

  6. Select the deployment profile from the context menu.

  7. Select Deploy to ADF Library JAR File in the Deployment Action page.

  8. Click Next. Review the Summary page, which notes the output location for the JAR file. This location is set in the JAR Options page of the Edit JAR Deployment Profile Properties dialog.

  9. Click Finish.

4.4 Creating an Application Workspace

The first steps in building an ADF Mobile client application are to assign it a name and to specify a directory where its source files will be saved. By creating an application using the application templates provided by JDeveloper, you automatically get the organization of your workspace into projects, along with many of the configuration files required by the type of application that you are creating.

4.4.1 How to Create an Application Workspace

You create an application workspace using the Create Mobile Client Application (ADF) Wizard.

Before you begin:

The model project containing the entity objects and view objects on which you base the ADF Mobile client application must be deployed as a JAR file on the development computer, which can subsequently be imported in an ADF Mobile client application. For information on creating an ADF library JAR, see "Packaging a Reusable ADF Component into an ADF Library" in Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework. See also Section 4.3, "Deploying the Model Project of the Base Application as an ADF Library."

To create a workspace:

  1. In the main menu, choose File > New.

  2. In the New Gallery, expand General, select Applications and then Mobile Client Application (ADF) and then click OK.

    Figure 4-1 Selecting the Application Type

    Select Mobile Client Application (ADF)
  3. In the Name your application page, enter a name for the application and if needed, change the directory name and application prefix and then click Next.

  4. In the Name your project page, change the name and location of the project, if needed. Click Next.

    Note:

    This step is optional.

    Figure 4-2 shows the ADF Mobile Client Model and Java technologies, which are selected by default. You must select these technologies if they do not appear in the Selected list. You must add the ADF Mobile Client Model technology to a model project if it is not already present.

    Figure 4-2 Selecting the Project Technologies

    The Mobile Client tech scope
  5. If needed, change the Java settings for the model project. Click Next.

    Note:

    This step is optional.
  6. In the Name your project page, enter a name, if needed, for the view controller project of the application. JDeveloper selects the ADF Mobile Client UI technology by default, which enables you to create task flows. Click Next.

    Note:

    This step is optional.

    Figure 4-3 shows the ADF Mobile Client UI technology selected by default. To create a task flow and define application pages, you must select this technology if it is not already selected.

    Figure 4-3 Creating the Mobile Client View Project

    Creating the view project
  7. If needed, change the Java settings for the view project.

    Note:

    This step is optional.
  8. Click Finish.

4.4.2 What Happens When You Create a Mobile Client Application Workspace

When you complete the entire Create Mobile Client Application wizard, JDeveloper creates two projects: a model project (which bears the default name, Model, as shown in Figure 4-4) and a view controller project. Table 4-1 lists the JDeveloper-generated files that are contained in this project, which has the default name, MobileClient.

Table 4-1 Artifacts of Mobile Client View Projects

Artifact Location Description

MobileClient-task-flow.xml

Application Sources

The source file for the mobile client task flow. By default, this is a bounded task flow. This file is created when you select the Mobile Client UI technology for the project. This is the mobile client equivalent to the adfc-config.xml or faces-config.xml in an ADF Faces application.

UiApplication.jad

META-INF

This JAD (Java Application Descriptor) file is required by BlackBerry to deploy applications. When you deploy a BlackBerry application, note that the BlackBerry Options page of the BlackBerry Deployment Profile Properties dialog contains entries written to this file before it is used to compile the application.

adf-config.xml

<appDir>/.adf/META-INF

A standard configuration file that specifies application-level settings that are usually determined at deployment and are read-only at runtime. ADF Mobile client uses specific key values in this file. This file has the same format as that used by ADF Faces. For information on adf-config.xml, see "adf-config.xml" in Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.


Figure 4-4 shows the MobileClient project in the Application Navigator, containing the files described in Table 4-1.

Figure 4-4 The MobileClient Project

MobileClient project

4.5 Extending the Base Application for the Mobile Client Application

Extending an ADF application that resides on a server for ADF Mobile client is usually the starting point in developing an application. Conceptually, the mobile client application is always an extension of an existing ADF application (referred to as a base application). Because of this, the entity objects of the mobile client application are always copies of the base application's entity objects. Entity objects define the data that is available to the ADF Mobile client application. View objects are based on the entity objects.

Not only are the entity objects of a mobile client application copies, they are also a subset of the entity objects used by the base application. While a base application may have 20 entity objects, a mobile application may require only five of them. Further, the mobile client application may only require a subset of the attributes owned by the selected entity objects.

You create these data subsets using the ADF Mobile Client Business Components from Entity Objects wizard. This wizard, described in Section 5.2, "Extending an ADF Application to Mobile Client," steps you through creating the entity objects and view objects.

Because you derive a mobile client application from a base (server) ADF application, you should assess which entity objects and view objects in the base application should be used in its mobile counterpart before you develop the mobile client application.

Note:

Read-only view objects that are based on SQL queries have limitations in Oracle Fusion Middleware 11g release 1 of ADF Mobile client. For example:
  • A SQL query-based, read-only view object contains all of the columns of a table, while a mobile client application typically synchronizes only a subset of these columns.

  • Although the mobile client ADF business components represent the client database schema, JDeveloper points to the database on the server rather than to the client database when determining which attributes to create for a SQL query-based, read-only view object. As a result, JDeveloper adds all of the columns on the server database to the view object, regardless of whether they exist on the client database.

If you create a read-only view object based on a SQL statement, you must:

  1. Ensure that the SQL query used to create the view object can run on the device. For information on the SQL query syntax, refer to http://www.sqlite.org

  2. Manually change the view object's attributes to match those of the database columns on the client database.