Skip Headers
Oracle® Fusion Middleware Mobile Browser Client Developer's Guide for Oracle Application Development Framework
11g Release 1 (11.1.1) for Windows
E10140-03
  Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
 
Next
Next
 

2 Configuring the ADF Mobile Browser Client Environment

This chapter describes how to configure the environment for ADF Mobile browser client applications and how to build and test ADF Mobile browser client applications.

This chapter includes the following sections:

2.1 Introduction to the ADF Mobile Browser Client Development Environment

ADF Mobile browser client application development is almost identical to ADF Web application development, except that ADF Mobile browser client application development uses only mobile JSF pages that consist of Apache MyFaces Trinidad components.


Note:

Oracle JDeveloper supports only the JSF page flows for ADF Mobile browser client application development. The ADF task flow is not supported.

To create an ADF Mobile browser client application:

2.2 Configuring the ADF Mobile Browser Client Development Environment

ADF Mobile browser client application development for desktop browsers differs only from ADF Web application development for desktop browsers in the creation of the Web project. For more information, see Section 2.3, "Developing an ADF Mobile Browser Client Application."

2.2.1 How to Configure the Environment by Creating a Mobile Application and Project

To configure the environment, first create an ADF Mobile browser client application that includes a project with the ADF Mobile browser client technology.

To create the ADF Mobile Browser Client Application and the ADF Mobile Browser Client Project

  1. Choose File and then New. The New Gallery appears (Figure 2-1).

    Figure 2-1 The New Gallery

    Fusion Web Application is highlighted in the New Gallery
  2. Choose Applications in the Categories section of the window and then Fusion Web Application (ADF) in the Items section. Selecting Fusion Web Application (ADF) creates the model project used by the mobile view project.

  3. Click OK. The Create Fusion Web Application (ADF) wizard opens to its first page, Step 1: Name your application. (Figure 2-2).

  4. Complete this page by entering a name and, if needed, a location for the application in the Directory field.

    Figure 2-2 The Name your application Page

    The Name your application page.
  5. Click Finish. The application's Model and its generated Model-View-Controller projects appear in the Application Navigator (Figure 2-3).

    Figure 2-3 The Fusion Web Application and its Projects in the Application Navigator

    Model and View-Controller projects

    Note:

    Define the business logic for the Model project, but do not use the generated Model-View-Controller project. Instead, create a mobile Model-View-Controller project as described in the following steps.

  6. Choose File and then New. The New Gallery appears.

  7. Select Projects in the Categories section and then Generic Project in the Items section.

  8. Click OK. The Create Generic Project wizard appears.

  9. Complete the wizard by first entering a name for the project. For example, enter mvc (a short name for Model-View-Controller mobile).


    Tip:

    To make entering a URL on a mobile device easier, enter short, lower-case names for both the application and the project.

  10. Select the ADF Mobile browser client technology for the project by moving Mobile Browser from the Available section to the Selected section. As depicted in Figure 2-4, the following technologies appear in the Selected section:

    • Java

    • JSF (JavaServer Faces)

    • JSP and Servlets

    • Mobile Browser

    Figure 2-4 Selecting the Mobile BrowserTechnology Scope

    The technologies of the ADF Mobile scope
  11. Click Next. The Configure Java settings for the project page appears.

  12. Click Finish to complete the project.

2.2.2 What Happens When You Create a Mobile Application and Project

The mobile Model-View-Controller project (mvc) appears in the Application Navigator (Figure 2-5) within the Fusion Web application (adfm).

Figure 2-5 The Mobile ADF Model-View-Controller Project in the Application Navigator

A Model-View-Controller project

Because you added the Mobile technology scope, the Apache MyFaces Trinidad library is automatically loaded to the workspace and the Trinidad component palette is loaded when you create mobile JSF pages (Figure 2-9).

2.3 Developing an ADF Mobile Browser Client Application

ADF Mobile browser client application development for desktop browsers is nearly identical to ADF Web application development for desktop browsers; the two only differ in how you create the Web project. For ADF Mobile browser client applications, you develop an ADF Mobile browser client application by creating Web pages within the Web project. Otherwise, you develop an ADF Mobile browser client application the same way that you develop an ADF Web application for a desktop browser. Typically, you create a Web project within the application to implement a user interface and ADF business components or an Oracle TopLink project to implement a business layer. Figure 2-6 illustrates an ADF Mobile application (adfm) that contains model, a business components project.

Figure 2-6 Creating a Business Components Project within an ADF Mobile Browser Client Application

ADF Mobile project and its contents

2.3.1 How to Develop an ADF Mobile Browser Client Application by Creating a Mobile JSF Page

You develop an ADF Mobile browser client application by first creating a JSP page and then populating it with the Apache My Faces Trinidad components.

To create a mobile JSF page

  1. Choose File and then New. The New Gallery appears.

  2. Select JSF from the Web Tier node in the Categories section.


    Note:

    Project Technologies (the default) must be selected from the Filter By list.

    Figure 2-7 The New Gallery for JSF Pages

    JSF category and JSF Page item are selected
  3. Select JSF Page in the Items section and then click OK. The Create JSF Page dialog box appears (Figure 2-8).


    Note:

    Because you added the Mobile technology scope for the application, the Render in Mobile Device option is selected by default.

  4. Figure 2-8 The Create JSF Page Dialog Box

    The Create JSF Page dialog box

    A page designer for a mobile JSF page appears (page1.jsp in Figure 2-9).

  5. Select the Trinidad component palette and then create the page using the Apache MyFaces Trinidad components. You can create the page in the same manner as a desktop ADF Web page.

Figure 2-9 Using the Trinidad Component Palette

The Trinidad component pallet

2.3.2 What Happens When You Create a Mobile JSF Page

Because the Render in Mobile Device option is selected by default, the page designer in the visual editor reflects the size of a mobile device, as illustrated in Figure 2-9.


Tip:

You change the size of the page in the visual editor or by clicking Tools, then Preferences, then Mobile.

2.4 Testing an ADF Mobile Browser Client Application

You can test an ADF Mobile browser client application on a mobile device, a mobile device emulator, or a desktop browser. Testing on an actual mobile device or mobile device emulator provides more accurate results than does testing on a desktop browser.

Using a desktop browser to test an ADF Mobile browser client application produces only approximate results. Desktop browsers provide a fairly uniform testing environment: Web pages appear and behave similarly and business logic executes identically in any type of browser.

Testing an application on an actual mobile device, however, produces more accurate results, because the capabilities of mobile browsers may cause controls to behave differently than they do on a desktop browser. In addition, mobile browsers are usually smaller than desktop browsers. They also render pages differently than desktop browsers because Web servers optimize the look and feel by generating pages that are specific to the mobile browser.

Testing ADF Mobile browser client applications directly on mobile devices has limitations as well, in that you may not have access to all of the devices that you must test. Further, development environments behind fire walls can interfere with testing on mobile devices that access the Internet. In such cases, mobile device emulators provide an alternative testing method. For example, to test applications on BlackBerry or Windows Mobile emulators (Figure 2-10 and Figure 2-12, respectively), first download device emulators from the RIM developer site (http://na.blackberry.com) and the Microsoft developer site (http://www.microsoft.com). Before you test applications on the emulator, you must first configure the emulator and connect it to the Web server. The Oracle Technology Network (http://www.oracle.com/technology/tech/wireless) provides information on downloading and configuring simulators for ADF Mobile browser client.

Figure 2-10 Testing an ADF Mobile Browser Client Application on a BlackBerry Emulator

Testing on a Blackberry simulator

2.4.1 How to Test ADF Mobile Browser Client Applications on Emulators

After you test an application on a desktop browser, you can then test it on an emulator. You can use the URL displayed in the desktop browser, but you must replace the local IP address with the IP address of the server that hosts the emulator. For example, to text an application using a Windows Mobile 6 emulator, change the address from the local IP used by the desktop to that of the server hosting the Windows Mobile 6 emulator.

Figure 2-11 Testing an ADF Mobile Browser Client Application on a Desktop Browser

Testing on desktop

For example, in Figure 2-11, the desktop browser displays the IP address of the local host, 127.0.0.1. In Figure 2-12, the IP address has been changed to that of the server hosting the Windows Mobile 6 emulator (192.02.253).


Tip:

To obtain the network IP address, use the ipconfig command interface on Windows systems and the ifconfig command on Linux/UNIX systems.

Figure 2-12 Testing an ADF Mobile Browser Client Application on a Windows Mobile Emulator

Testing on Windows Mobile emulator

In addition, you must remove the session specification that follows the page name. The page name is typically appended with either .jspx or .jsp. In Figure 2-11, the page name, home, is appended with .jspx.

In general, you debug an application by repeating cycles of code and then by testing the application. When you test an application that has been modified, you must do one or both of the following:

  • Refresh the page.

  • Clear the browser's cache.


Tip:

Because the URL does not change if you develop the same application, you are not required to enter it again.

2.4.2 What You May Need to Know About Browser Settings

To view ADF Mobile browser client applications properly requires adjustments to the browser settings for Windows Mobile and BlackBerry browsers.

Microsoft Windows Mobile 5 and 6, Microsoft Pocket Internet Explorer

For optimal viewing, select the Fit to Screen view (accessed by selecting Menu, View and then Fit to Screen).


Note:

Do not select the One Column view because it causes layout problems.

RIM BlackBerry Browser 4.x

ADF Mobile browser client only works if JavaScript support is enabled. To ensure that JavaScript support is enabled:

  1. Select Options and then Browser Configuration.

  2. Ensure that the following tables are selected:

    • Support JavaScript

    • Allow JavaScript Popup

    • Support HTML Tables