F Mobile Application Framework Sample Applications
This appendix describes the Mobile Application Framework sample applications.
This appendix includes the following section:
F.1 Overview of the MAF Sample Applications
Mobile Application Framework ships with a set of a sample applications that provide different development scenarios, such as creating the basic artifacts, accessing such device-native features as SMS and e-mail, or performing CRUD (Create, Read, Update, and Delete) operations on a local SQLite database. These applications are in the PublicSamples.zip
file at the following location within the JDeveloper installation directory of your development computer:
jdev_install/jdeveloper/jdev/extensions/oracle.maf/Samples
To view these applications, extract the PublicSamples.zip
file to your JDeveloper working directory (typically, this is User Home Directory
/jdeveloper/mywork
).
Note:
The sample applications that include a default springboard must be extracted to, and opened from, the Samples
directory. To enable these applications to function properly, you must ensure that the springboard is added to the classpath by updating the maf-application.xml
file as described in Section 4.5.1, "How to Configure Application Navigation."
To add the springboard to the classpath:
-
Open the application from the
Samples
directory. -
In the Applications page of the overview editor for the
maf-application.xml
file, change the springboard option from Default to None. -
Choose Default as the springboard option.
-
Click Save All.
-
Deploy the application.
These applications, which are described in Table F-1, are complete. Except where noted otherwise, these applications can be deployed to a simulator after you configure the development environment as described in Chapter 2, "Setting Up the Development Environment."
Tip:
To get an idea of how to create a mobile application, review these applications in the order set forth in Table F-1.
Table F-1 MAF Sample Applications
Application Name | Description | Additional Resources Required to Run the Sample Application |
---|---|---|
HelloWorld |
The "hello world" application for MAF, which demonstrates the basic structure of the framework. This basic application has a single application feature that is implemented with a local HTML file. Use this application to ascertain that the development environment is set up correctly to compile and deploy an application. See also Section 3.2.2, "What Happens When You Create a MAF Application." |
|
CompGallery |
This application serves as an introduction to the MAF AMX UI components by demonstrating all of these components. Using this application, you can change the attributes of these components and see the effects of those changes in real time without recompiling and redeploying the application after each change. See generally Chapter 6, "Creating the MAF AMX User Interface." |
|
UIDemo |
This application demonstrates the user interface layout and shows how to create the various list and button styles that are commonly used in mobile applications. It also demonstrates how to create the action sheet style of a popup component and how to use various chart and gauge components. See Section 6.3, "Creating and Using UI Components" and Section 6.5, "Providing Data Visualization." |
This application must be opened from the |
FragmentDemo |
This application shows how you can use fragments to define reusable artifacts that can used as templates. It demonstrates how you can have multiple content types for each feature, one for tablet, one for phone, and use the fragment so that you don't have to code the list/form each time. |
|
Navigation |
This application demonstrates the various navigation techniques in MAF, including bounded task flows and routers. It also demonstrates the various page transitions. See also Section 5.2, "Creating Task Flows." |
This application must be opened from the |
LifecycleEvents |
This application implements lifecycle event handlers on the mobile application itself and its embedded application features. This application shows you where to insert code to enable the applications to perform their own logic at certain points in the lifecycle. See also Section 4.7, "About Lifecycle Event Listeners." |
For iOS, the LifecycleEvents sample application logs data to the Console application, located at Applications-Utilities-Console application. |
DeviceDemo |
This application shows you how to use the DeviceFeatures Data Control to expose device features such as geolocation, e-mail, SMS, and contacts, as well as how to query the device for its properties. This feature demonstrates how to use |
You must also run this application on an actual device, because SMS and some of the device properties do not function on an iOS simulator or Android emulator. |
GestureDemo |
This application demonstrates how gestures can be implemented and used in MAF applications. See also Section 6.4, "Enabling Gestures." |
|
StockTracker |
This sample demonstrates a simple example of how to build CRUD operations using a SQLite DB and a dean data control. It displays a list of stocks and allows you to Create, Update, Delete or Reorder the stocks. It uses a local SQLite database to store its data. The StockTracker application persists the data during CRUD operations. This sample also demonstrates how data change events use Java to enable data changes to be reflected in the user interface. It also has a variety of layout use cases, gestures, and basic mobile application layout patterns. This sample also demonstrates how to use CREATE and DELETE operations to add or delete items to and from a collection. For more details, look at the |
|
WorkBetter |
This human resources application contains two features: People and Organizations.People: This feature includes a search component, which allows you to search for people. It also demonstrates the ability to create custom components as well as how to build reusable layouts as fragments and use them between different features. It demonstrates how to use various DVT visualization components to display performance, compensation, and timeline- related information. Organizations: Like the People feature, this feature demonstrates how to build reusable layouts as fragments and use them between different features. It also demonstrates how to create views for different form factors and configure them. This application is meant to be an end-to-end demo of the various UI techniques and components available. It shows a variety of layout patterns and demonstrates various uses for both common and more complex components. It is not meant to showcase a compete application but rather focus on the user interface. Please consult other samples for things like data-model or web services. |
|
SkinningDemo |
This application demonstrates how to skin applications and add a unique look and feel by either overriding the supplied style sheets or extending them with their own style sheets. This application also shows how skins control the styling of MAF AMX UI components based on the type of device. It also demonstrates the ability to change skin families (out-of-the-box or custom) at runtime. See also Section 4.12, "Skinning Mobile Applications." |
|
PrefDemo |
This application demonstrates application-wide and application feature-specific user setting pages. See generally Chapter 14, "Enabling User Preferences." |
|
Weather1 |
This application, which does not use Java code, demonstrates using declarative web services. The web services used by this application are SOAP web services, specifically a public web service provided by CDYNE Corporation ( |
|
Weather2 |
This application demonstrates using a programmatic invocation of web services and parsing the |
|
Weather3 |
Although this application is identical to the Weather2 sample application, it demonstrates the use of a non-blocking background thread to invoke the web service and how the user interface is updated when the service returns. This application demonstrates how it updates the user interface by flushing the data change events from the thread. |
|
RESTDemo |
This application demonstrates using REST web services. Its two application features, REST-XML and REST-JSON use the same publicly available web service to retrieve the geo-coordinates of a given IP address or domain. The service can return either XML or JSON formats. The REST-XML application feature uses an XSD and creates a URL data control to access the structured data. The user interface binds to that data control. In the REST-JSON version, the URL connection is used directly by the |
|
APIDemo |
This application demonstrates how to invoke custom JavaScript methods from within a MAF AMX page. Use this approach to invoke the Apache Cordova APIs that are not included in the DeviceFeatures data control. You can also use this approach to add custom JavaScript methods to an application and invoke them as well. This application also demonstrates calling back to Java from the JavaScript methods. For more information, see Section 4.9.1, "How to Define the Basic Information for an Application Feature" and Section B.2, "The MAF Container Utilities API." |
|
RangeChangeDemo |
This sample demonstrates how to invoke a |
|
BarcodeDemo |
This application demonstrates how to make use of a Cordova plugin by calling the BarcodeScanner plugin from embedded JavaScript that is invoked from a backing bean. Android and iOS versions of the plugin were manually added to the application controller and view controller projects, then registered within the |