Luc Bors, june 2013, ODTUG KScope 2013 New Orleans
Best Practices for Developing Applications
with Oracle ADF Mobile
Oracl...
Who Am I
•  Luc Bors
•  Principal Consultant
•  AMIS Nieuwegein Netherlands
•  Friends of Oracle & Java
•  5 Oracle ACE(D)...
ADF Mobile Overview
17 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Device
Services
How It Works?
...
ADF mobile vs. Vanilla ADF
•  The Obvious Differences
•  The Annoying Differences
•  The Not so Obvious Differences
•  The...
The Obvious Differences
•  Mobile
•  Multiple Platforms
•  Multiple Form Factors
•  Touchscreens
What Device are you on ?
•  Device info	

	

•  Device Properties
Work With Form Factors
•  Respond to Form Factors
•  Conditionally Render Different content
Demo
Using the mouse for…..
•  Clicking Menu Items
•  Clicking Links & Buttons
•  Expanding / Collapsing
•  Selecting / Deselec...
Gesture Support
•  You can configure Button, Link, and List Item components to react to the
following gestures:
•  Swipe t...
Gesture examples
•  The Swipe Gesture
•  The Tap Gesture
<amx:actionListener binding="#{mybean.DoX}"
type="swipeRight"/>
<...
Annoying differences
A simple calculator….
•  In Vanilla ADF…… •  InputText for Value
•  Autosubmit
•  OutputText for Result
•  PartialTriggers...
This is annoying….
•  ADF Mobile
•  Autosubmit and PartialTriggers does not exist !
•  2 Options
I.  Use application Scope...
PropertyChangeSupport
The not so obvious ones
•  No menu structure…..
•  What about Application Start ?
•  What about Navigation ?
•  No ADF Bus...
Springboard & navigationbar
•  Springboard configuration in adfmf-application.xml
The Default Springboard
The Custom SpringBoard
Configuring the springboard
Using the Local Database
Creating the Local Database
Register Listener
Using the POJO Datacontrol
Talking to the DB (Select)
Talking to the DB (DML…)
Using Webservices
•  Create a Webserivce Datacontrol
Using Webservices (1)
•  Just drag & drop the method from the Data Control
Using Webservices (1)
•  The PageDefinition File
•  The PageDefinition
Using Webservices (2)
•  Invoke directly from java.
•  Does not use the binding layer
•  Uses Framework utilityMethod
•  A...
Advice
•  Do Not Hook Up Webservices Directly to Your Page
–  Use Multiple Layers of Datacontrols For Abstraction
–  You a...
Demo
Use Caching
•  By default the webservice will be called on every request
•  Simply compare if what is in memory is the sam...
The return of the invokeAction
•  The current row in ADF Mobile is not preserved across pages that bind to
the same data c...
The Nice Differences
•  Device Interaction
•  Thematic Maps
Device Interaction
•  The Device Datacontrol
•  Drag n Drop support
•  Attributes as fields
•  Operations as buttons
Camera interaction
•  Take a picture ……………
•  …… or get one from the Library
import oracle.adf.model.datacontrols.device;
...
Be careful !!
•  DESTINATIONTYPE_DATA_URL you will get the image as base64 encoded
string
•  Camera’s are very good.
•  Pi...
Demo
I wish ADF could do this
Custom Thematic Map
•  Configuration File
•  Custom Image
Custom Thematic Map
Custom Thematic Map
Demo
Summary
•  Today was about differences
•  Know the differences
•  Know the ADF Mobile way to do it
•  There are many paral...
Questions ?
Luc Bors, AMIS, The Netherlands	

Luc.Bors@amis.nl	

LucBors@gmail.com	

Follow me on : @lucb_
ADF Mobile: Best Practices for Developing Applications with Oracle ADF Mobile - Luc Bors
ADF Mobile: Best Practices for Developing Applications with Oracle ADF Mobile - Luc Bors
ADF Mobile: Best Practices for Developing Applications with Oracle ADF Mobile - Luc Bors
ADF Mobile: Best Practices for Developing Applications with Oracle ADF Mobile - Luc Bors
Upcoming SlideShare
Loading in …5
×

ADF Mobile: Best Practices for Developing Applications with Oracle ADF Mobile - Luc Bors

2,535 views

Published on

There are many web-based or device-native techniques to create mobile applications. To support multiple
devices, such as iPhones, iPads, and Android phones and tablets, an application needs to be developed several
times, using multiple tools, languages, and platforms. This dramatically lowers the ROI. Oracle JDeveloper and
Oracle Application Development Framework (Oracle ADF) allow you to create one single application, based on
HTML5, that runs on multiple mobile device platforms. This session demonstrates how to create a mobile
application that can be used 'on the road' to perform relevant tasks, no matter what device is used. You will learn
best practices on how to connect with server side datasources and the on device database. Finally you will learn
how to integrate with device services such as calendar and camera.

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,535
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
104
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

ADF Mobile: Best Practices for Developing Applications with Oracle ADF Mobile - Luc Bors

  1. 1. Luc Bors, june 2013, ODTUG KScope 2013 New Orleans Best Practices for Developing Applications with Oracle ADF Mobile Oracle ADF Mobile
  2. 2. Who Am I •  Luc Bors •  Principal Consultant •  AMIS Nieuwegein Netherlands •  Friends of Oracle & Java •  5 Oracle ACE(D) •  Oracle Partner
  3. 3. ADF Mobile Overview 17 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Device Services How It Works? Phone Gap Device Native Container Web View Server HTML ADF Mobile XML View Java Managed Beans ADF Model Third Party Web Sites ADF Faces RC ADF Mobile Browser Mobile Device Web Services (SOAP & REST) Local HTML HTML5 & JavaScript Configuration Server ADF Controller Local'Data' CredentialManagement, SSO&AccessControl Application Configuration Server
  4. 4. ADF mobile vs. Vanilla ADF •  The Obvious Differences •  The Annoying Differences •  The Not so Obvious Differences •  The Nice Differences
  5. 5. The Obvious Differences •  Mobile •  Multiple Platforms •  Multiple Form Factors •  Touchscreens
  6. 6. What Device are you on ? •  Device info •  Device Properties
  7. 7. Work With Form Factors •  Respond to Form Factors •  Conditionally Render Different content
  8. 8. Demo
  9. 9. Using the mouse for….. •  Clicking Menu Items •  Clicking Links & Buttons •  Expanding / Collapsing •  Selecting / Deselecting
  10. 10. Gesture Support •  You can configure Button, Link, and List Item components to react to the following gestures: •  Swipe to the right •  Swipe to the left •  Swipe up •  Swipe down •  Tap-and-hold
  11. 11. Gesture examples •  The Swipe Gesture •  The Tap Gesture <amx:actionListener binding="#{mybean.DoX}" type="swipeRight"/> <amx:showPopupBehavior popupid="pop1" type="tapHold“ />
  12. 12. Annoying differences
  13. 13. A simple calculator…. •  In Vanilla ADF…… •  InputText for Value •  Autosubmit •  OutputText for Result •  PartialTriggers •  Managed Bean •  Holds the values
  14. 14. This is annoying…. •  ADF Mobile •  Autosubmit and PartialTriggers does not exist ! •  2 Options I.  Use application Scoped Variables (no Coding) •  Not meant for this purpose II.  Use the Property Change Listener Pattern
  15. 15. PropertyChangeSupport
  16. 16. The not so obvious ones •  No menu structure….. •  What about Application Start ? •  What about Navigation ? •  No ADF Business Components •  Now what ?
  17. 17. Springboard & navigationbar •  Springboard configuration in adfmf-application.xml
  18. 18. The Default Springboard
  19. 19. The Custom SpringBoard
  20. 20. Configuring the springboard
  21. 21. Using the Local Database
  22. 22. Creating the Local Database
  23. 23. Register Listener
  24. 24. Using the POJO Datacontrol
  25. 25. Talking to the DB (Select)
  26. 26. Talking to the DB (DML…)
  27. 27. Using Webservices •  Create a Webserivce Datacontrol
  28. 28. Using Webservices (1) •  Just drag & drop the method from the Data Control
  29. 29. Using Webservices (1) •  The PageDefinition File •  The PageDefinition
  30. 30. Using Webservices (2) •  Invoke directly from java. •  Does not use the binding layer •  Uses Framework utilityMethod •  AdfmfJavaUtilities.invokeDataControlMethod() •  Datacontrol must be in available in DataBindings.cpx
  31. 31. Advice •  Do Not Hook Up Webservices Directly to Your Page –  Use Multiple Layers of Datacontrols For Abstraction –  You are in control
  32. 32. Demo
  33. 33. Use Caching •  By default the webservice will be called on every request •  Simply compare if what is in memory is the same as what needs to be shown. if (!s_locationsList.isEmpty()){ MyLocation cur = (MyLocation)s_locationsList.get(0); Integer currentLoc = cur.getId(); if (currentLoc.compareTo(Integer.valueOf(<NEWVALUE>))!=0){ // clear cache callWebservice(); } }
  34. 34. The return of the invokeAction •  The current row in ADF Mobile is not preserved across pages that bind to the same data collection •  Steps: –  Inside the <amx:listItem> element of the list page, you need to add a <amx:setPropertyListener> element to store the row key in a pageFlowScope variable. –  In the page definition of the detail page, you need to add a setCurrentRowWithKey action, which uses the pageFlowScope variable to set the current row. –  In the page definition of the detail page, you need to add an invokeAction executable for the setCurrentRowWithKey action to ensure the current row is automatically set when entering the detail page. –  http://www.ateam-oracle.com/adf-mobile-preserving-the-current-row-across-pages/
  35. 35. The Nice Differences •  Device Interaction •  Thematic Maps
  36. 36. Device Interaction •  The Device Datacontrol •  Drag n Drop support •  Attributes as fields •  Operations as buttons
  37. 37. Camera interaction •  Take a picture …………… •  …… or get one from the Library import oracle.adf.model.datacontrols.device; DeviceManagerFactory.getDeviceManager().getPicture(100, DeviceManager.CAMERA_DESTINATIONTYPE_FILE_URI, DeviceManager.CAMERA_SOURCETYPE_CAMERA, false, DeviceManager.CAMERA_ENCODINGTYPE_PNG, 0, 0); DeviceManager.CAMERA_SOURCETYPE__PHOTOLIBRARY
  38. 38. Be careful !! •  DESTINATIONTYPE_DATA_URL you will get the image as base64 encoded string •  Camera’s are very good. •  Picture quality is amazing. –  Encoding such images as base64 causes memory issues •  Don’t blow up your app. –  iOS you should set quality parameter to a value less then 50 to avoid –  On Android out-of-memory can be caused with default image settings. Make image smaller by setting targetWidth and targetHeight
  39. 39. Demo
  40. 40. I wish ADF could do this
  41. 41. Custom Thematic Map •  Configuration File •  Custom Image
  42. 42. Custom Thematic Map
  43. 43. Custom Thematic Map
  44. 44. Demo
  45. 45. Summary •  Today was about differences •  Know the differences •  Know the ADF Mobile way to do it •  There are many parallels •  Developing ‘feels’ like Vanilla ADF •  Component Based Developement •  ADF ‘like’ config files •  DataControl / DataBinding •  My advise •  Use ADF Mobile like ADF •  Know The DataControl by heart •  Know how to use Multiple (levels) of Datacontrols •  Use Java; it is more flexible then declarative
  46. 46. Questions ?
  47. 47. Luc Bors, AMIS, The Netherlands Luc.Bors@amis.nl LucBors@gmail.com Follow me on : @lucb_

×