E MAF Sample Applications

This appendix describes the MAF sample applications.

This appendix includes the following section:

E.1 Overview of the MAF Sample Applications

MAF 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).

These applications, which are described in Table E-1 , are complete. Except where noted otherwise, these applications can be deployed to a simulator after you configure the development environment as described in Installing Oracle Mobile Application Framework.

The HelloWorld application is listed first and then the rest of the applications appear in alphabetical order.


Table E-1 MAF Sample Applications

Application Name Description Additional Resources Required to Run the Sample Application Keywords

HelloWorld

This is a "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 What Happens When You Create a MAF Application.

 

Local HTML

ACS

This application provides the REST services that are used within the SecurityDemo application to configure the login server and the Access Control Service.

This web application needs to be deployed on a WebLogic server.

REST; Access Control Service

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 as well as invoke these methods. In addition, this application demonstrates how to call back to Java from the JavaScript methods. See also Setting Display Properties for an Application Feature and The MAF Container Utilities API.

 

JavaScript; Java

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. See also Using Plugins in MAF Applications .

 

Cordova; Barcode; JavaScript

BeaconDemo

This application demonstrates how to make use of a Cordova plugin to detect iBeacons. See also Using Plugins in MAF Applications .

 

Cordova; Beacon; JavaScript; Local notifications

CompGallery

This application serves as an introduction to the MAF AMX UI components by demonstrating all of the components. Using this application, you can change the attributes of the UI components and see the effects of those changes in real time without recompiling and redeploying the application after each change. See generally Creating the MAF AMX User Interface .

 

UI layout; AMX

ConfigServiceDemo

This application demonstrates the use of the Configuration Service to change the end points used in a MAF application. Changes to end points in the connections.xml file are propagated to the application on the mobile device and the application reinitializes to consume the new end points. See also Introduction to Configuring End Points in MAF Applications .

This application is used with the ACS sample application, which hosts the remote connections.xml file.

Configuration Service; Whitelisting; Connections

CRUDDemo

This application demonstrates how to build CRUD operations using the SQLite database and Java bean data controls. This application displays a list of employees and allows you to create, update, and delete employees. This application uses a local SQLite database to store its data, persisting the data during CRUD operations. In addition, this application shows how to use CREATE and DELETE operations to add or delete items to and from a collection. See generally:

 

Java; SQLite; Database

DatePicker

This application demonstrates the usage of a custom Cordova plugin to invoke the mobile device's native date picker component. In addition, this application shows how to use a custom MAF AMX component to invoke the custom Cordova plugin. See generally:

 

Cordova; Custom AMX

DeviceDemo

This application demonstrates how to use the DeviceFeatures data control to expose mobile device features such as geolocation, email, SMS, and contacts, as well as how to query the mobile device for its properties. This application also demonstrates how to use the displayFile method from the DeviceFeatures data control to display various file types such as .doc, .ppt, .xls, and .png. See also:

You must run this application on an actual mobile device, because SMS and some of the device properties do not function on an iOS simulator or Android emulator.

DeviceFeatures Data Control; Geolocation; SMS; Contacts; displayFile; Cordova

ExpandCollapseComponent

This application demonstrates how to create a custom component that can act as a container for any type of MAF AMX component. It also provides an example of expand and collapse functionality. For details, see the cardview.js file in the js folder of the application. This JavaScript file contains a method (expandcollapse.prototype.render) that renders the UI of the component. It also contains a method that demonstrates how to render the child components of the custom UI component. See also Creating Custom MAF AMX UI Components .

 

Custom AMX component; JavaScript

FakeBeacon

This application demonstrates how to make use of a Cordova plugin to pretend to be an iBeacon. This application can be used in conjunction with the BeaconDemo application if you do not have an actual iBeacon for testing. See also Using Plugins in MAF Applications .

 

Cordova; Beacon; JavaScript

FragmentDemo

This application demonstrates how to use fragments to define reusable artifacts that can be used as templates. It shows how you can have multiple content types for each application feature (for example, one for tablet, one for phone) and use the fragment so that you do not have to code the list or form every time. It shows how to use static attributes as well as a variable list of attributes sent into the fragment. It also shows how to expose facets and popup components embedded within a fragment. See also:

 

Fragments; UI Layout, AMX

GestureDemo

This application demonstrates how gestures can be implemented and used in MAF applications. See also Enabling Gestures.

 

Gestures

LifecycleEvents

This application implements lifecycle event handlers on the MAF 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 Using Lifecycle Listeners in MAF Applications .

For iOS, the LifecycleEvents sample application logs data to the Console application, located at Applications-Utilities-Console application.

Lifecycle events

LocalNotificationDemo

This application demonstrates how to schedule and receive local notifications within a MAF application. See also Managing Local Notifications.

 

Local notifications

Navigation

This application demonstrates the various navigation techniques in MAF, including bounded task flows and routers. It also demonstrates page transitions. See also Creating Task Flows.

 

Navigation; Task flows; Routers; Transitions

PrefDemo

This application demonstrates application-wide and application feature-specific user setting pages. See generally Enabling User Preferences .

 

Preferences; Settings

PushDemo

This application demonstrates how to register for and receive push notifications from the Apple Push Notification and Google Could Messaging servers. This application registers with the Apple Push Notification service (APNs) or the Google Cloud Messaging (GCM) server, as appropriate, and enables the user to register a unique user ID with the server application. From the server application, it is possible to fire a push notification via APNs or GCM to the mobile device running this application and, ultimately, the message contained in the push notification will be displayed in this application. See also Enabling Push Notifications.

This application is used with the PushServer sample application, which provides the ability to initiate a push notification.

Push notifications

PushServer

This web application works in conjunction with the PushDemo application to demonstrate how to implement push notifications. See also Enabling Push Notifications.

This web application needs to be deployed on a WebLogic server.

Push notifications

RangeChangeDemo

This application demonstrates how to use a RangeChangeEvent to invoke a Java handler method when the MAF AMX List View component requires new data to be fetched from an external source. It also demonstrates how to configure the scrolling and buffering behavior of a List View component using its attributes. See also Configuring Paging and Dynamic Scrolling.

 

Range change listener; Range change event; List view; Scrolling; Buffering

SecurityDemo

This application demonstrates how to secure a MAF application, configure authentication and the login server, use the Access Control Service, and access secure web services. See also Introduction to MAF Security.

This application is used with the ACS sample application, which provides the REST services used to configure the login server and the Access Control Service.

Authentication; Login; Access Control Service; Security

SkinningDemo

This application demonstrates how to skin MAF 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 mobile device. It also demonstrates the ability to change skin families (out-of-the-box or custom) at runtime. See also Skinning MAF Applications.

 

Skin, AMX

SlidingWindows

This application demonstrates the use of the AdfmfSlidingWindowUtilities API, which can be used to display multiple MAF application features on the screen at the same time. This application shows how you can create a custom springboard or a global navigation bar using the AdfmfSlidingWindowUtilities API. See also Creating a Sliding Window in a MAF Application.

 

Sliding windows

StockTracker

This application demonstrates how data change events use Java to enable data changes to be reflected in the user interface. In addition, this application provides a variety of UI layout use cases, gestures, and basic mobile patterns. This application also demonstrates how to enable the client-side validation by using the MAF AMX Validation Group component (see the editStock.amx included in the Portfolio part). See also:

 

Data change events; UI layout; Gestures; UX patterns; Validation

UILayoutDemo

This application demonstrates various MAF AMX UI constructs and techniques, focusing on different page layouts (flowing, stretch, or split view). See also Designing the Page Layout.

 

UI layout; AMX; DVT

URLSchemeDemo

This application demonstrates how to define a custom URL scheme for a MAF application so that you can invoke it from a URL link in a browser, email, or another application. See also Invoking MAF Applications Using a Custom URL Scheme.

 

URL scheme

WorkBetter

This human resources application allows several different roles to perform a simulated login to the application to obtain different dashboard data. From there, the organization's critical data can be viewed, The data, such as performance, compensation, and timeline-related information, is displayed via various data visualization components. In addition, the application contains an employee directory and provides a way to view profiles of specific employees.

The application demonstrates the capabilities of the MAF AMX UI component set, particularly the data visualization components that can be used to create a very compelling UI. The application navigation demonstrates how to define task flows to incorporate reusable parts of the application, as well as perform deep drilling and backing out of those task flows. This application provides an extensive demonstration of various MAF AMX UI techniques and components, such as UI layout patterns and uses for both common and more complex UI components.

Note:

This is not a compete MAF application that takes advantage of all the device features, but rather a showcase of the MAF AMX UI capabilities. Consult other MAF sample applications for demonstrations of device feature integration, data persistence to the local SQLite database, data create, update, and delete patterns, and so on.

See generally Creating the MAF AMX User Interface .

 

UI layout; UX patterns; Fragments; REST