Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
REAL-LIFE ORACLE MAF
Luc Bors eProseed NL
ODTUG Mobile Day, Utrecht
April 21st 2015
Things You Don’t Learn from Oracle’s
Developer’s Guide
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |2
WHO AM I ?
• Luc Bors
• Managing Partner
• eProseed NL
• Oracle Partner
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
PROGRAM AGENDA
Introducing Oracle MAF
The Basics; DnD Development
Device Properties, Springboard, Gestures (Common Patterns)
Some Annoyances
Device Interaction
REST JSON : why wait for the Server Side Developer ?
1
2
3
4
5
3
6
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |4
BEFORE WE START
• Let’s look at some basic terms related to MAF and
Mobile
– Springboard
– Gestures
– Feature
– Device Interaction
– Notifications
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
PROGRAM AGENDA
Introducing Oracle MAF
The Basics; DnD Development
Device Properties, Springboard, Gestures (Common Patterns)
Some Annoyances
Device Interaction
REST JSON : why wait ?
1
2
3
4
5
5
6
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |6
TO DND OR NOT TO DND ?
• Drag and Drop Development
• Pro’s
– Quick
• Cons
– Dirty
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |7
TO DND OR NOT TO DND ?
• Drag and Drop Development Demo
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |8
TO DND OR NOT TO DND ?
• Drag and Drop Development of your app
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |9
CREATE FRAGMENTS
• Create Fragments that
can be re-used
• Fragments can have
styling
• Assign Attribute values
when Fragment is used
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |10
USE FRAGMENTS
• Drop fragment on
page
• Assign Attribute
values
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |11
TO DND OR NOT TO DND ?
• The hard work
– Create page fragments first
– Create bindings manually
– Assign attribute Values
• VS
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
PROGRAM AGENDA
Introducing Oracle MAF
The Basics; DnD Development
Device Properties, Springboard, Gestures (Common Patterns)
Some Annoyances
Device Interaction
REST JSON : why wait ?
1
2
3
4
5
12
6
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |13
DEVICE PROPERTIES
• Benefit from Device properties
• Do what is possible,
avoid what cannot be done
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |14
LOADING IN THE BACKGROUND
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
HOW IT WORKS
• Check network connectivity
– #{deviceScope.hardware.networkStatus}
– "wifi", "2g", "unknown", "none”, etc etc
• Start background thread
– Load Images in background
15
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |16
LOADING IN THE BACKGROUND
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
DEMO
17
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
PROGRAM AGENDA
Introducing Oracle MAF
The Basics; DnD Development
Device Properties, Springboard, Gestures (Common Patterns)
Some Annoyances
Device Interaction
REST JSON : why wait ?
1
2
3
4
5
18
6
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
CONTROLLING YOUR APPLICATION
• Springboard configuration in adfmf-application.xml
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
THE DEFAULT SPRINGBOARD
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
THE CUSTOM SPRINGBOARD
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
CONFIGURING THE SPRINGBOARD
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
FEATURE ARCHIVES
• Feature Archives can be reused
• Deploy ADF Mobile app as FAR
• Consume features from FAR in other apps
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |24
CUSTOM TOGGLE SPRINGBOARD
• What is the Default ?
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |25
CUSTOM TOGGLE SPRINGBOARD
• Use AdfmfSlidingWindowUtilities API.
– oracle.adfmf.framework.api.AdfmfSlidingWindowUtilities
– Note that the sliding window plugin API can only be used for
features defined within the application that do not appear in
the navigation bar and is not the springboard feature .
– So in order to make a custom springboard that nicely slides in
and out of view we need to instruct the app that it has NO
springboard, and create a custom feature that functions as a
springboard.
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |26
CUSTOM TOGGLE SPRINGBOARD
• What is the Custom ?
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
PROGRAM AGENDA
Introducing Oracle MAF
The Basics; DnD Development
Device Properties, Springboard, Gestures (Common Patterns)
Some Annoyances
Device Interaction
REST JSON : why wait ?
1
2
3
4
5
27
6
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
GESTURES ( AND UX )
• Gestures can be
used from:
– Buttons
– Links
– List Item
<amx:showPopupBehavior popupid="pop1"
type="tapHold“ />
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
GESTURE ABUSE
• .. Or how to confuse your app user…
<amx:showPopupBehavior popupid="pop1"
type=”swipeLeft“ />
<amx:actionListener binding="#{mybean.deleteRow}"
type=”swipeDown"/>
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
WHAT APPLE DID (IOS6  IOS7)
• I rest my case……
• Make sure to be
aware of the right
standard:
– For Device
– For OS
– For version
• They changed delete swipe from right to left…….
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
THIS IS HELPFULL
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
USE CASE EXAMPLE
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
INGREDIENTS
• A (Web) service and datacontrol
• A Page with Listview
• An ActionListener with type
SwipeDown
• Smart Java Code to call service
(conditionally)
<amx:listView var="row”
value="#{bindings.allLocations.collectionModel}"
fetchSize="#{bindings.allLocations.rangeSize}”
id="lv1">
<amx:listItem id="li1">
<amx:actionListener type="swipeDown”
binding="#{pageFlowScope.locationsBackingBean.checkForUpdates}”>
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
EXAMPLE
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
PROGRAM AGENDA
Introducing Oracle MAF
The Basics; DnD Development
Device Properties, Springboard, Gestures (Common Patterns)
Some Annoyances
Device Interaction
REST JSON : why wait ?
1
2
3
4
5
35
6
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
WHERE ARE MY LOGFILES ?
• Finding the actual log file for an app, particularly since
iOS 8 and Xcode 6, is a somewhat tricky
• Logfile
– application.log
36
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
THERE ARE MY LOGFILES !
• iOS simulator content
– /Users/lucbors/Library/Developer/CoreSimulator
37
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
THERE ARE MY DEVICES !
• iOS simulator content
– /Users/lucbors/Library/Developer/CoreSimulator/Devices
38
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
THERE IS MY DEVICE !
• iOS simulator content
– /Users/lucbors/Library/Developer/CoreSimulator/Devices
– Use ls -lt
39
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
THERE IS MY APPLICATION !
• iOS simulator content
– /Users/lucbors/Library/Developer/CoreSimulator/Devices/<devic
e>/data/Containers/Data/Application
40
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
THERE IS MY LOGFILE !
• iOS simulator content
– /Users/lucbors/Library/Developer/CoreSimulator/Devices/<devic
e>/data/Containers/Data/Application/<app>/Documents/logs
41
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
WHERE ARE MY LOGFILES ?
• Change Location
42
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
PROGRAM AGENDA
Introducing Oracle MAF
The Basics; DnD Development
Device Properties, Springboard, Gestures (Common Patterns)
Some Annoyances
Device Interaction
REST JSON : why wait ?
1
2
3
4
5
43
6
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
DEVICE INTERACTION
• The Device
Datacontrol
• Drag n Drop support
• Attributes as fields
• Operations as buttons
• Or as a link
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
BEHIND THE SCENES
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
CAMERA INTERACTION
• Take a picture ……………
import oracle.adf.model.datacontrols.device;
DeviceManager dm = DeviceManagerFactory.getDeviceManager();
if (dm.hasCamera){
dm.getPicture(
100,
DeviceManager.CAMERA_DESTINATIONTYPE_FILE_URI,
DeviceManager.CAMERA_SOURCETYPE_CAMERA,
false,
DeviceManager.CAMERA_ENCODINGTYPE_PNG,
200,
200);
}
DeviceManager.CAMERA_SOURCETYPE_PHOTOLIBRARY
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
MOBILE MAPS
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
GOOGLE PLACES
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
USE GPS FOR LOCATION BASED SERVICES
public Location getPosition(){
DeviceManager dm=DeviceManagerFactory.getDeviceManager();
Location currentPosition = dm.getCurrentPosition( 60000,true);
return currentPosition;
}
Location myPosition = getPosition();
String locationParameter = “location=”
+ myPosition.getLatitude();
+”,”
+ myPosition.getLongitude();
restServiceAdapter.setRequestURI(
"json?”
+locationParameter
+”&radius=1000”
+”&types=food”
+”&sensor=false&key=<yourApiKey>");
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
DISPLAY ON THE MAP
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |51
PUSH NOTIFICATIONS
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
LOCAL NOTIFICATIONS
• Declarative
– DeviceFeatures DC
• JavaScript API
– adf.mf.api.localnotification
• Java API
– adfmfContainerUtilities
52
both
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
CREATING A LOCAL NOTIFICATION
• AdfmfContainerUtilities.addLocalNotification(options)
• AdfmfContainerUtilities.cancelLocalNotification(notificationId);
53
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
REPEATING LOCAL NOTIFICATIONS
54
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |55
CANCELING REPEATING NOTIFICATIONS
• Cancelling a notification means that the notification is
COMPLETELY cancelled even if it was scheduled to
fire every DAY
• Create a new one after cancelling
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |
PROGRAM AGENDA
Introducing Oracle MAF
The Basics; DnD Development
Device Properties, Springboard, Gestures (Common Patterns)
Some Annoyances
Device Interaction
REST JSON : why wait
1
2
3
4
5
56
6
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |57
OVERVIEW OF A MAF SOLUTION
JSONBeanSerializationHelper
POJO Datacontrol Data Objects
Data Objects
Data ObjectsDataArray
REST Adapter
MAFBindingLayer
RemoteRESTJSON
R
E
S
T
C
o
n
n
e
c
t
i
o
n
MAF App
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |58
MAF WITH REST JSON ON OSB
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |59
CLASS HIERARCHY
RestCallerUtil
FlightCustURIs
JsonArrayToFlightPassengerListArray JsonArrayToFlightDetailsArray
FlightPassengerListArray FlightDetailsArray
FlightPassengerListEntity FlightDetailsEntity
FlightPassengersDC
CustomerComplaintEntity
FlightsRestService
CustomerComplaintObject
CustomerComplaintObjectToJsonObject
CustomerRestService
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |60
RESTSERVICE ADAPTER DOES THE CALL
• setRequestType
– REQUEST_TYPE_GET  to GET flights and Passengers
– REQUEST_TYPE_POST  to POST a complaint
• setConnectionName: To use the correct REST-connection
• setRequestURI  What is it that we want to do
– /flights/KL34
– /flights/KL34/passengerlist
– /complaints
• NOTE: Request URI are bundled in a Custom Class (FlightCustURIs)
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |61
DEMO WITHOUT THE OSB
{ "FlightCode": {
"CarrierCode": "KL",
"FlightNumber": "34"
},
"FlightDate": "2015-03-07T09:50:00.000+01:0
"TotalNumberOfPassengers": "22",
"Passengers": [
{
"FirstName": "Diana",
"LastName": "Woodstock",
"Country": "UK",
"FrequentFlyerNumber": "BB123332",
"Seat": "2B"
},
{
"FirstName": "William",
"LastName": "Simon",
"Country": "US",
"FrequentFlyerNumber": "KK9182673",
"Seat": "4C"
},
Copyright © 2014, eProseed and/or its affiliates. All rights reserved. |62
SUMMARY
• Many Options to Develop
• Many Features to Use
• Highly Configurable
• Use Common Patterns
Real life-maf-2015

Real life-maf-2015

  • 1.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | REAL-LIFE ORACLE MAF Luc Bors eProseed NL ODTUG Mobile Day, Utrecht April 21st 2015 Things You Don’t Learn from Oracle’s Developer’s Guide
  • 2.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |2 WHO AM I ? • Luc Bors • Managing Partner • eProseed NL • Oracle Partner
  • 3.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | PROGRAM AGENDA Introducing Oracle MAF The Basics; DnD Development Device Properties, Springboard, Gestures (Common Patterns) Some Annoyances Device Interaction REST JSON : why wait for the Server Side Developer ? 1 2 3 4 5 3 6
  • 4.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |4 BEFORE WE START • Let’s look at some basic terms related to MAF and Mobile – Springboard – Gestures – Feature – Device Interaction – Notifications
  • 5.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | PROGRAM AGENDA Introducing Oracle MAF The Basics; DnD Development Device Properties, Springboard, Gestures (Common Patterns) Some Annoyances Device Interaction REST JSON : why wait ? 1 2 3 4 5 5 6
  • 6.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |6 TO DND OR NOT TO DND ? • Drag and Drop Development • Pro’s – Quick • Cons – Dirty
  • 7.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |7 TO DND OR NOT TO DND ? • Drag and Drop Development Demo
  • 8.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |8 TO DND OR NOT TO DND ? • Drag and Drop Development of your app
  • 9.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |9 CREATE FRAGMENTS • Create Fragments that can be re-used • Fragments can have styling • Assign Attribute values when Fragment is used
  • 10.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |10 USE FRAGMENTS • Drop fragment on page • Assign Attribute values
  • 11.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |11 TO DND OR NOT TO DND ? • The hard work – Create page fragments first – Create bindings manually – Assign attribute Values • VS
  • 12.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | PROGRAM AGENDA Introducing Oracle MAF The Basics; DnD Development Device Properties, Springboard, Gestures (Common Patterns) Some Annoyances Device Interaction REST JSON : why wait ? 1 2 3 4 5 12 6
  • 13.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |13 DEVICE PROPERTIES • Benefit from Device properties • Do what is possible, avoid what cannot be done
  • 14.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |14 LOADING IN THE BACKGROUND
  • 15.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | HOW IT WORKS • Check network connectivity – #{deviceScope.hardware.networkStatus} – "wifi", "2g", "unknown", "none”, etc etc • Start background thread – Load Images in background 15
  • 16.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |16 LOADING IN THE BACKGROUND
  • 17.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | DEMO 17
  • 18.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | PROGRAM AGENDA Introducing Oracle MAF The Basics; DnD Development Device Properties, Springboard, Gestures (Common Patterns) Some Annoyances Device Interaction REST JSON : why wait ? 1 2 3 4 5 18 6
  • 19.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | CONTROLLING YOUR APPLICATION • Springboard configuration in adfmf-application.xml
  • 20.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | THE DEFAULT SPRINGBOARD
  • 21.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | THE CUSTOM SPRINGBOARD
  • 22.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | CONFIGURING THE SPRINGBOARD
  • 23.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | FEATURE ARCHIVES • Feature Archives can be reused • Deploy ADF Mobile app as FAR • Consume features from FAR in other apps
  • 24.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |24 CUSTOM TOGGLE SPRINGBOARD • What is the Default ?
  • 25.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |25 CUSTOM TOGGLE SPRINGBOARD • Use AdfmfSlidingWindowUtilities API. – oracle.adfmf.framework.api.AdfmfSlidingWindowUtilities – Note that the sliding window plugin API can only be used for features defined within the application that do not appear in the navigation bar and is not the springboard feature . – So in order to make a custom springboard that nicely slides in and out of view we need to instruct the app that it has NO springboard, and create a custom feature that functions as a springboard.
  • 26.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |26 CUSTOM TOGGLE SPRINGBOARD • What is the Custom ?
  • 27.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | PROGRAM AGENDA Introducing Oracle MAF The Basics; DnD Development Device Properties, Springboard, Gestures (Common Patterns) Some Annoyances Device Interaction REST JSON : why wait ? 1 2 3 4 5 27 6
  • 28.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | GESTURES ( AND UX ) • Gestures can be used from: – Buttons – Links – List Item <amx:showPopupBehavior popupid="pop1" type="tapHold“ />
  • 29.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | GESTURE ABUSE • .. Or how to confuse your app user… <amx:showPopupBehavior popupid="pop1" type=”swipeLeft“ /> <amx:actionListener binding="#{mybean.deleteRow}" type=”swipeDown"/>
  • 30.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | WHAT APPLE DID (IOS6  IOS7) • I rest my case…… • Make sure to be aware of the right standard: – For Device – For OS – For version • They changed delete swipe from right to left…….
  • 31.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | THIS IS HELPFULL
  • 32.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | USE CASE EXAMPLE
  • 33.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | INGREDIENTS • A (Web) service and datacontrol • A Page with Listview • An ActionListener with type SwipeDown • Smart Java Code to call service (conditionally) <amx:listView var="row” value="#{bindings.allLocations.collectionModel}" fetchSize="#{bindings.allLocations.rangeSize}” id="lv1"> <amx:listItem id="li1"> <amx:actionListener type="swipeDown” binding="#{pageFlowScope.locationsBackingBean.checkForUpdates}”>
  • 34.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | EXAMPLE
  • 35.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | PROGRAM AGENDA Introducing Oracle MAF The Basics; DnD Development Device Properties, Springboard, Gestures (Common Patterns) Some Annoyances Device Interaction REST JSON : why wait ? 1 2 3 4 5 35 6
  • 36.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | WHERE ARE MY LOGFILES ? • Finding the actual log file for an app, particularly since iOS 8 and Xcode 6, is a somewhat tricky • Logfile – application.log 36
  • 37.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | THERE ARE MY LOGFILES ! • iOS simulator content – /Users/lucbors/Library/Developer/CoreSimulator 37
  • 38.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | THERE ARE MY DEVICES ! • iOS simulator content – /Users/lucbors/Library/Developer/CoreSimulator/Devices 38
  • 39.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | THERE IS MY DEVICE ! • iOS simulator content – /Users/lucbors/Library/Developer/CoreSimulator/Devices – Use ls -lt 39
  • 40.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | THERE IS MY APPLICATION ! • iOS simulator content – /Users/lucbors/Library/Developer/CoreSimulator/Devices/<devic e>/data/Containers/Data/Application 40
  • 41.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | THERE IS MY LOGFILE ! • iOS simulator content – /Users/lucbors/Library/Developer/CoreSimulator/Devices/<devic e>/data/Containers/Data/Application/<app>/Documents/logs 41
  • 42.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | WHERE ARE MY LOGFILES ? • Change Location 42
  • 43.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | PROGRAM AGENDA Introducing Oracle MAF The Basics; DnD Development Device Properties, Springboard, Gestures (Common Patterns) Some Annoyances Device Interaction REST JSON : why wait ? 1 2 3 4 5 43 6
  • 44.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | DEVICE INTERACTION • The Device Datacontrol • Drag n Drop support • Attributes as fields • Operations as buttons • Or as a link
  • 45.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | BEHIND THE SCENES
  • 46.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | CAMERA INTERACTION • Take a picture …………… import oracle.adf.model.datacontrols.device; DeviceManager dm = DeviceManagerFactory.getDeviceManager(); if (dm.hasCamera){ dm.getPicture( 100, DeviceManager.CAMERA_DESTINATIONTYPE_FILE_URI, DeviceManager.CAMERA_SOURCETYPE_CAMERA, false, DeviceManager.CAMERA_ENCODINGTYPE_PNG, 200, 200); } DeviceManager.CAMERA_SOURCETYPE_PHOTOLIBRARY
  • 47.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | MOBILE MAPS
  • 48.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | GOOGLE PLACES
  • 49.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | USE GPS FOR LOCATION BASED SERVICES public Location getPosition(){ DeviceManager dm=DeviceManagerFactory.getDeviceManager(); Location currentPosition = dm.getCurrentPosition( 60000,true); return currentPosition; } Location myPosition = getPosition(); String locationParameter = “location=” + myPosition.getLatitude(); +”,” + myPosition.getLongitude(); restServiceAdapter.setRequestURI( "json?” +locationParameter +”&radius=1000” +”&types=food” +”&sensor=false&key=<yourApiKey>");
  • 50.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | DISPLAY ON THE MAP
  • 51.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |51 PUSH NOTIFICATIONS
  • 52.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | LOCAL NOTIFICATIONS • Declarative – DeviceFeatures DC • JavaScript API – adf.mf.api.localnotification • Java API – adfmfContainerUtilities 52 both
  • 53.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | CREATING A LOCAL NOTIFICATION • AdfmfContainerUtilities.addLocalNotification(options) • AdfmfContainerUtilities.cancelLocalNotification(notificationId); 53
  • 54.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | REPEATING LOCAL NOTIFICATIONS 54
  • 55.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |55 CANCELING REPEATING NOTIFICATIONS • Cancelling a notification means that the notification is COMPLETELY cancelled even if it was scheduled to fire every DAY • Create a new one after cancelling
  • 56.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. | PROGRAM AGENDA Introducing Oracle MAF The Basics; DnD Development Device Properties, Springboard, Gestures (Common Patterns) Some Annoyances Device Interaction REST JSON : why wait 1 2 3 4 5 56 6
  • 57.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |57 OVERVIEW OF A MAF SOLUTION JSONBeanSerializationHelper POJO Datacontrol Data Objects Data Objects Data ObjectsDataArray REST Adapter MAFBindingLayer RemoteRESTJSON R E S T C o n n e c t i o n MAF App
  • 58.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |58 MAF WITH REST JSON ON OSB
  • 59.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |59 CLASS HIERARCHY RestCallerUtil FlightCustURIs JsonArrayToFlightPassengerListArray JsonArrayToFlightDetailsArray FlightPassengerListArray FlightDetailsArray FlightPassengerListEntity FlightDetailsEntity FlightPassengersDC CustomerComplaintEntity FlightsRestService CustomerComplaintObject CustomerComplaintObjectToJsonObject CustomerRestService
  • 60.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |60 RESTSERVICE ADAPTER DOES THE CALL • setRequestType – REQUEST_TYPE_GET  to GET flights and Passengers – REQUEST_TYPE_POST  to POST a complaint • setConnectionName: To use the correct REST-connection • setRequestURI  What is it that we want to do – /flights/KL34 – /flights/KL34/passengerlist – /complaints • NOTE: Request URI are bundled in a Custom Class (FlightCustURIs)
  • 61.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |61 DEMO WITHOUT THE OSB { "FlightCode": { "CarrierCode": "KL", "FlightNumber": "34" }, "FlightDate": "2015-03-07T09:50:00.000+01:0 "TotalNumberOfPassengers": "22", "Passengers": [ { "FirstName": "Diana", "LastName": "Woodstock", "Country": "UK", "FrequentFlyerNumber": "BB123332", "Seat": "2B" }, { "FirstName": "William", "LastName": "Simon", "Country": "US", "FrequentFlyerNumber": "KK9182673", "Seat": "4C" },
  • 62.
    Copyright © 2014,eProseed and/or its affiliates. All rights reserved. |62 SUMMARY • Many Options to Develop • Many Features to Use • Highly Configurable • Use Common Patterns

Editor's Notes

  • #23 allowDeviceAccess="false" is an invalid setting for a feature that is used as a custom springboard. Application doesn't start at all when "show Springboard On Application launch" is checked. Also no feedback on what this is causing.
  • #29 https://wikis.oracle.com/display/ADFMobileDesign/Pattern+-+Display+Gestures
  • #30 http://mashable.com/2012/04/11/mobile-app-design-tips/ nummer 10 10. Don’t Forget About Gestures, But Don’t Abuse Them Either Keep in mind that not every single element of the interface has to be fully visible or easy to get to immediately. A great example is the deletion process in the Mail app for iPhone. In the inbox view, a user can swipe a message to reveal a delete button. This is a shortcut that saves the user the hassle of tapping “edit,” selecting a message to delete and then tapping delete. But it’s a balance: The “delete” shortcut is a way to quickly remove an email, while the “edit” menu is reserved for those who don’t know about the shortcut or who want to take advanced actions such as deleting or flagging multiple messages at a time. In other words, keep gestures in mind, but don’t become overly reliant on them. And generally avoid using a gesture-accessed menu or action as the only point of access.
  • #33 One very common pattern in Mobile Apps is the use of "pull" to refresh a list of data in an App. This pattern can be implemented with MAF using gestures and some of the previously learned techniques
  • #34 To implement this pattern we need a webservice that gathers the data Also a bean that calls this webservice and has its own data control. This is exactly as discussed earlier in presentation at the bean datacontrol service object pattern. This will call the webservice and expose the data to the datadcotnrol This collection canbe dropped on the page as a list view and finally you need an action listener that on “Swipe Down” calls out the bean to chech wether or not there are any changes that need to be refreshed.
  • #45 ADF Mobile exposes device-specific features that you can use in your application through the DeviceFeaturers data control, a component that appears in the Data Controls panel when you create a new ADF Mobile application. The Cordova Java API is abstracted through this data control, enabling the application features implemented as ADF Mobile AMX to access various services embedded on the device. By dragging and dropping the operations provided by the DeviceFeatures data control into an ADF Mobile AMX page, you can add functions to manage the user contacts stored on the device, create and send both email and SMS text messages, ascertain the location of the device, use the device’s camera, and retrieve images stored in the device’s file system. Again note that dragging and Dropping from the datacontrol on to your page is very convenient but not necessarily best practice. This way of working results in thightly couping the datacontrol to your ADF Mobile AMX Page. There is an API available that allows you to interact with the device form Java code, giving more control and flexibility.