3 Configuring the Content of a MAF Application

This chapter describes using the MAF Application Editor and MAF Features Editor to define the display behavior of the mobile application's springboard and navigation bar and how to designate content by embedding application features.

This chapter includes the following sections:

3.1 Introduction to Configuring MAF Application Display Information

You can configure the display information that appears to the end users of your MAF application by setting values in the MAF Application Editor, which provides a declarative interface for editing the maf-application.xml file. Examples of the type of information you enter for the application include the display name, a description of your application, and the application's version number. You can enter similar information for individual application features that you include in your MAF application or distribute for use in other MAF applications. Additionally, you can specify icons that an application feature displays when it renders in a MAF application's navigation bar or springboard.

3.2 Setting Display Properties for a MAF Application

Figure 3-1 shows the MAF Application Editor where you set the display name and application ID of your MAF application.

Before you begin

Open the MAF Application Editor by double-clicking MAF Application Editor (located in the MAF node of the assembly project in the Project Explorer panel, as shown in Figure 3-1).

Figure 3-1 Selecting MAF Application Editor in the Project Explorer

This image is described in the surrounding text

To set the basic information for a mobile application:

  1. Choose the Application page by selecting the application's name in the Outline.

    Note:

    By default, the editor opens the Application page.

    Figure 3-2 shows the portion of the application page where you define the basic information.

    Figure 3-2 Setting the Basic Information for the Mobile Application

    This image is described in the surrounding text
  2. Enter a display name for the application in the Name field. This attribute can be localized. For more information, see Introduction to MAF Application Localization.

    Note:

    MAF uses the value entered in this field as the name for the iOS archive (.ipa or .app) file that it creates when you deploy the application to an iOS-powered device or simulator. For more information, see How to Create an iOS Deployment Configuration.

  3. Accept the default, or enter a unique ID in the Id field.

    To avoid naming collisions, Android and iOS use reverse package names, such as com.company.application. OEPE prefixes com.company as a reverse package to the application name, but you can overwrite this value with another as long as it is unique and adheres to the ID guidelines for both iOS- and Android-powered devices. For iOS application, see the "Creating and Configuring App IDs" section in iOS Team Administration Guide (available from the iOS Developer Library at http://developer.apple.com/library/ios). For Android, refer to the document entitled "The AndroidManifest.xml File," which is available from the Android Developers website (http://developer.android.com/guide/topics/manifest/manifest-intro.html). You can overwrite this ID in the deployment profiles described in How to Create an Android Deployment Configuration and How to Create an iOS Deployment Configuration.

    Note:

    To ensure that an application deploys successfully to an Android-powered device or emulator, the ID must begin with a letter, not with a number or a period. For example, an ID comprised of a wholly numeric value, such as 925090 (com.company.925090) will prevent the application from deploying. An ID that begins with letters, such as hello925090 (com.company.hello925090) will enable the deployment to succeed.

  4. Enter a short, but detailed summary of the application that describes the application's purpose in the Description field.
  5. Enter the version in the Version field.
  6. Enter the name of the vendor who originated this application in the Vendor field.
  7. In the Lifecycle Event Listener field, enter a class with code that executes in response to lifecycle events in your MAF application. A newly-created MAF application specifies application.LifeCycleListenerImpl by default.

    For more information, see Using Lifecycle Listeners in MAF Applications.

    The default application listener class is application.LifeCycleListenerImpl. MAF does not register this class by default, because it starts the JVM and therefore may not be preferable for each mobile application. You must instead register this class manually using the Select Class dialog, shown in Figure 3-2. After you close this dialog, OEPE updates the <adfmf:application> element with a listener-class attribute, as illustrated in the example below of adding the listener-class Attribute.

    Note:

    The application lifecycle listener must remain within the application controller project (its default location).

    <adfmf:application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                       xmlns:adfmf="http://xmlns.oracle.com/adf/mf"
                       name="OracleMobileApplication"
                       id="com.company.OracleMobileApplication"
                       appControllerFolder="ApplicationController" 
                       listener-class="application.LifeCycleListenerImpl"
                       version="1.1"
                       vendor="Oracle">
       <adfmf:description>This is a mobile application</adfmf:description>
       <adfmf:featureReference id="feature1"/>
    </adfmf:application>
    

    For more information, see Introduction to Lifecycle Listeners in MAF Applications.

3.3 Changing the Launch Screen for Your MAF Application on iOS

MAF provides a HTML page to display the launch screen that appears to end users when your MAF application starts up on an iOS device.

This HTML page is designed to render responsively on the iOS device where the MAF application runs. That is, the page uses the available screen and displays the copyright information and logo in a size appropriate to the device.

You can create a custom HTML page where you define an alternative launch screen. You do this from the Launch Screen section of the Navigation tab of the MAF Application Editor. The HTML page you create is saved in the application project/ViewContent directory of your MAF application. The following XML entries appear in the maf-application.xml file's source if you create a HTML page to use as a launch screen:

...
  <adfmf:configuration>
    <adfmf:launchScreen url="custom-launch-screen.html"/>
  </adfmf:configuration>
...

The URL attribute defines the path, relative to the application project/ViewContent directory, that the application uses to find the HTML page you create as the launch screen.

View the HTML page that MAF renders as the default launch screen for iOS devices for ideas on how to create a custom HTML page to render as the launch screen. The default launch screen (maf-launch-screen.html) can be found in the following sub-directory of the deployment profile that you use to first deploy the MAF application:

.../FARs/OracleStandardADFmfUiComponents/public_html/

3.4 Setting Display Properties for an Application Feature

Each MAF application must have at least one application feature. Application features can be developed independently of each other (and also from the MAF application itself). The MAF Features Editor enables you to define the child elements of <adfmf:features> in the maf-feature.xml file to differentiate the application features by assigning each application feature a name, an ID, and setting how their content can be implemented. Using the overview editor for application features, you can also control the runtime display of the application feature within MAF application and designate when an application feature requires user authentication.

Figure 3-3 shows the MAF Features Editor for the WorkBetter sample application. Use this tab to specify information such as the name of the application feature and the icons that display in the springboard and navigation bar.

Figure 3-3 Application Features in MAF Features Editor

This image is described in the surrounding text