adf mobile - an intro for developers

47
MOBILE DEVELOPMENT WITH JDEVELOPER AND ADF Luc Bors, AMIS, The Netherlands Monday October 12 th 2012 KC ADF Mobile Nieuwegein, Nederland

Upload: lucbors

Post on 01-Nov-2014

3.321 views

Category:

Automotive


3 download

DESCRIPTION

This is the presentation that used at november 12th during the AMIS Knowledge session on ADF Mobile

TRANSCRIPT

Page 1: ADF Mobile - an intro for Developers

MOBILE DEVELOPMENT WITH JDEVELOPER AND ADF

Luc Bors, AMIS, The NetherlandsMonday October 12th 2012 KC ADF Mobile Nieuwegein, Nederland

Page 2: ADF Mobile - an intro for Developers

ADF MOBILE

• Declaratively develop hybrid on-device apps• Access local storage and device services

(camera, bar scanner, etc.)• Reuse existing ADF development skills• Minimize development cycle for supporting new mobile platforms

Page 3: ADF Mobile - an intro for Developers

NATIVE MOBILE USER EXPERIENCE

• Device native user experience• Spring board and tab bar for feature

navigation• Advanced HTML5-based UI

• Full animation, gesture, and touch interaction support

• Interactive Data Visualization Components

Page 4: ADF Mobile - an intro for Developers

TIGHT DEVICE SERVICES INTEGRATION

• Thin native application container provides device services integration

• Leverages Open Sourced PhoneGap

• Abstracted for easy integration

• Common interface across all platforms

• Gracefully handle device services availability

• Version ….. 1.1

Page 5: ADF Mobile - an intro for Developers

ADF MOBILE ARCHITECTURE

Page 6: ADF Mobile - an intro for Developers

SUPPORTED PLATFORMS, DEVICES, AND DATABASES

ADF Mobile supports the following platforms:• Apple iOS 5 or later• Android 2.3 or laterThe following mobile devices are supported:• Apple iPhone• Apple iPad• Android-powered devices

The supported database • SQLite

Page 7: ADF Mobile - an intro for Developers

DEVELOPMENT OVERVIEW

• Setup Development Environment• Configure JDevoper• Create a new Application• Create Taskflows• Create Pages• Add Components to Pages• Add Gesture Support• Add Device Interaction• Deployment the Application

Page 8: ADF Mobile - an intro for Developers

CONFIGURE IDE FOR ADF MOBILE

Page 9: ADF Mobile - an intro for Developers

CREATE A NEW ADF MOBILE APP.

Page 10: ADF Mobile - an intro for Developers

CREATED ARTIFACTS (PROJECT)

Page 11: ADF Mobile - an intro for Developers

ADF MOBILE TASKFLOWS

Page 12: ADF Mobile - an intro for Developers

ADF MOBILE TASKFLOWS

• Supported activities– Method calls– Router– View Activity

Page 13: ADF Mobile - an intro for Developers

CREATING ADF MOBILE PAGES

Page 14: ADF Mobile - an intro for Developers

BUILDING THE AMX PAGES

• Layout First

• Input / Output / Command Components

• More Advanced Components

• Behavior

• Device Interaction

Page 15: ADF Mobile - an intro for Developers

USING LAYOUT COMPONENTS

• Panel Group Layout• Panel Form Layout• Panel Label and Message• List View• List Item• Popup• Panel Splitter• Panel Item• Table Layout• Row Layout• Spacer

Page 16: ADF Mobile - an intro for Developers

XML, VISUAL, DECLARATIVE<amx:outputText id="outputText1“ value="Sub-Section Title 1" styleClass="amx-text-sectiontitle"/> <amx:panelFormLayout id="panelFormLayout1" labelPosition="start"> <amx:panelLabelAndMessage id="panelLabelAndMessage1" label="Name"> <amx:commandLink id="commandLink1" text="Jane Doe" action="editname" /> </amx:panelLabelAndMessage> ………………………………….. </amx:panelFormLayout>

Page 17: ADF Mobile - an intro for Developers

USING UI COMPONENTS

• Input Text• Input Number Slider• Input Date• Output Text• Button• Link• Image• Checkbox• Select Many

Checkbox• Select Many Choice• Select Button• Radio Button• Carousel• Verbatim

Page 18: ADF Mobile - an intro for Developers

ADF MOBILE COMPONENT SET

• Input Date Field

<amx:inputNumberSlider id="inputNumberSlider1“ label="Input Number" minimum="0" maximum="20" stepSize="1" value="10"/>

<amx:inputDate id="inputDate1" label="Input Date" value="#{myBean.date}"/>

• Input Number Slider

Page 19: ADF Mobile - an intro for Developers

USING A CAROUSEL

<amx:carousel id="carousel1“ value="#{bindings.products.collectionModel}“ > <amx:facet name="nodeStamp"> <amx:carouselItem id="item1" text="#{item.name}" shortDesc="Product: #{item.name}"> <amx:commandLink id="link1" action="goto-productDetails" actionListener="#{someMethod()}"> <amx:image id="image1" source="images/img-big-#{item.uid}.png"/> </amx:commandLink> </amx:carouselItem> </amx:facet></amx:carousel>

Page 20: ADF Mobile - an intro for Developers

USING DATA VISUALIZATION

• areaChart • barChart • bubbleChart• comboChart• lineChart• pieChart• scatterChart• sparkChart

• LedGauge• StatusMeterGauge

• Geographic Map• Thematic Map

Page 21: ADF Mobile - an intro for Developers

USING DATA VISUALIZATION

<dvtm:bubbleChart id="bubbleChart_1" value="#{ChartData.bubble_data_alt.data}" var="row"> <amx:facet name="dataStamp"> <dvtm:chartDataItem label="#{row.group}" x="#{row.data.x}" y="#{row.data.y}" size="#{row.data.z}"> <dvtm:attributeGroups type="color" value="#{row.series}"/> <dvtm:attributeGroups type="shape" value="#{row.group}"/> </dvtm:chartDataItem></amx:facet>

Page 22: ADF Mobile - an intro for Developers

BEHAVIOR : 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

Page 23: ADF Mobile - an intro for Developers

BEHAVIOR : GESTURE SUPPORT

• The Swipe Gesture

• The Tap Gesture

<amx:actionListener binding="#{mybean.DoX}" type="swipeRight"/>

<amx:showPopupBehavior popupid="pop1" type="tapHold“ />

Page 24: ADF Mobile - an intro for Developers

DEPLOYING THE APPLICATION

• One click deployment to ….– Device– Simulator/Emulator– Package

• Finally– Publish to appStore– Publish to Google Play

Page 25: ADF Mobile - an intro for Developers

CREATE A DEPLOYMENT PROFILE

• ADF Mobile for Android

• ADF Mobile for iOS

• Both have multiple configuration options

Page 26: ADF Mobile - an intro for Developers

ANDROID DEPLOYMENT PROFILE

Page 27: ADF Mobile - an intro for Developers

IOS DEPLOYMENT PROFILE

Page 28: ADF Mobile - an intro for Developers

DEMO

ADF Mobile Demo

Page 29: ADF Mobile - an intro for Developers

DEVICE INTERACTION

• The Device Datacontrol

• Drag n Drop support

• Attributes as fields

• Operations as buttons

Page 30: ADF Mobile - an intro for Developers

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

Page 31: ADF Mobile - an intro for Developers

………. AND MORE

• Send Emails

• Create Contacts

• Send SMS

DeviceManagerFactory.getDeviceManager().sendEmail

DeviceManagerFactory.getDeviceManager().findContacts.createContact(aContact);

DeviceManagerFactory.getDeviceManager().sendSMS(“03000100", “Testmessage");

Page 32: ADF Mobile - an intro for Developers

USING THE LOCAL DATABASE

Page 33: ADF Mobile - an intro for Developers

DATABASE SCRIPTS

Page 34: ADF Mobile - an intro for Developers

CREATING A LOCAL DATABASE

Page 35: ADF Mobile - an intro for Developers

USING WEBSERVICES

• Create Webservice Datacontrol

Page 36: ADF Mobile - an intro for Developers

USING WEBSERVICES

• Just drag & drop the method from the Data Control

Page 37: ADF Mobile - an intro for Developers

USING WEBSERVICES

• The Page

• D

• The Pagedefinition

Page 38: ADF Mobile - an intro for Developers

USING WEBSERVICES (2)

• Invoke directly from java.• Does not use the binding layer

• Uses Framework utilityMethod

• AdfmfJavaUtilities.invokeDataControlMethod()

• Use generic Types

Page 39: ADF Mobile - an intro for Developers

USING GENERIC TYPES

• Why is this important to know?  Because invokeDataControlMethod returns GenericType objects and developers either need to parse these GenericType objects themselves or use one of our helper functions.

Page 40: ADF Mobile - an intro for Developers

DEMO

DEMO Weather Service

Page 41: ADF Mobile - an intro for Developers

DATA CHANGE EVENTS

• Use the propertyChangeSupport Class

• Automatically generated when Bean getters and setters are created• firePropertyChange• removePropertyChangeListener• AddPropertyChangeListener

• And that is the way the framework captures changes, push them to the client cache and notify the UI.

Page 42: ADF Mobile - an intro for Developers

DEBUGGING ADF MOBILE APPS

The following are the steps you need to do to use JDeveloper to debug the Java code

1.Configure the project properties for remote debugging by creating an ADF Model debugging configuration

2.Deploy the application to a mobile device or simulator

3.Specify the debugging parameters in the cvm.properties file

4.Redeploy and start the application 5.Start the debugger from JDeveloper

Page 43: ADF Mobile - an intro for Developers

DEBUGGING ADF MOBILE APPS

Page 44: ADF Mobile - an intro for Developers

DEBUGGING ADF MOBILE APPS

Page 45: ADF Mobile - an intro for Developers

DEMO

DEMO Debugging

Page 46: ADF Mobile - an intro for Developers

SUMMARY

• ADF Mobile allows you to use your ADF development skills

• Extensive component support (including DVT)

• Great user experience…

• Build once…

• ….. Deploy to multiple platforms from within Jdeveloper

Page 47: ADF Mobile - an intro for Developers

MOBILE DEVELOPMENT WITH JDEVELOPER AND ADF

Luc Bors, AMIS, The [email protected]@gmail.comFollow me on : @lucb_