SlideShare une entreprise Scribd logo
1  sur  34
Télécharger pour lire hors ligne
SVJFXUG – JavaFX Mobile Dojo



February 10, 2010
Hinkmond Wong
Senior Staff Engineer
Sun Oracle

                               1
Agenda
Introduction
End-to-end deployment: Moving JavaFX apps from
  Desktop to Mobile
JavaFX Mobile Do's and Dont's
Java ME integration: Co-mingling JavaFX code with
  Java ME
Demo: JavaFX Mobile running on cool devices
Q&A




                                                    2
Agenda
Introduction
End-to-end deployment: Moving JavaFX apps from
  Desktop to Mobile
JavaFX Mobile Do's and Dont's
Java ME integration: Co-mingling JavaFX code with
  Java ME
Demo: JavaFX Mobile running on cool devices




                                                    3
JavaFX: Simple, Declarative Scripting
Language
             class HelloWorld {
                var message : String;
                function print() { println(message); }
             }
             var name = "Jan";
             var hello = HelloWorld {
                message: bind "Hello {name}!"
             }
             hello.print(); // prints Hello Jan!
             name = "Brian";
             hello.print(); // prints Hello Brian!




                                                         4
JavaFX Scenegraph
Tree-like structure of graphical nodes
Easy way of vector graphics representation

Scene {
  Group {                   javafx.scene.shape
    Rectangle,                   Rectangle
    Circle
  }
}                                      javafx.scene.shape
                                              Circle



                                                            5
JavaFX Block Diagram
   JavaFX Applications and Services

   JavaFX Apps Framework
                                                Authoring
                                                 Tools
    JavaFX         JavaFX         JavaFX
    Desktop         Mobile          TV             Developer
    Runtime        Runtime        Runtime            Tools
                                                (IDE Plug ins, RAD,
                                                  Production Suite)
     Desktop         Mobile           TV
    Extensions     Extensions     Extensions        Designer
                                                     Tools
   JavaFX Common Profile                       (Authoring, Publishing,
                                                  Media Encoding)



   Java Platform (Java Plug in)

                                                                         6
JavaFX Common Profile Features
 Components                                    Features
Compiler and
 Languages     SE 5 and CLDC Target


               Geometric shapes, lines,            Clip with arbitrary geometric shapes
               curves, arc                         Image masks
Graphics       Transparency                        Fullscreen support
               Gradient, color fill, texture       transforms (rotate, scale skew)
               Stroke styles

               True Type font rendering
Text           Transforms (rotate, scale, skew)
               Content embedded font

                                                                                          7
JavaFX Common Profile Features
 Components                            Features
              Key frame animation             Standard animations
Animation     with tweening                   (rotate, zoom, slide)
              Path-based animation

              Cross platform audio (mp3)      Volume and audio balance control
              and video (On2)
Media         Codec native media framework
              support (DirectShow and
              Core Video), play, pause, seek,
              volume, balance, speed controls
              Web services (JSON/XML parser, RESTful APIs)
Other         Common text input control (CSS skinning)
              Input handling (keyboard, mouse, touch, etc.)

                                                                                 8
JavaFX Developer Tool Chain
Media Assets                     Assets          Integrated   Emulated By
 Created By                  Transformed By       Into IDEs   (If Required)

        Adobe
     Illustrator
                                                  JavaFX
                                                  Plug-in
               Adobe
                                                 for IDEs
             Photoshop        JavaFX                          JavaFX
                             Production                        Mobile
                               Suite             JavaFX       Emulator
        On2 Flix                                 Compiler
        Encoders
     (JavaFX File Format,
        VP6 and MP3)


             Adobe CS3
               (Flash and            3rd Party
              Flash Video,
              JavaFX 1.5)            RAD Tool


                                                                              9
JavaFX Plugin for NetBeans




                             10
Incorporate Existing Visual Assets with
JavaFX Production Suite




                                          11
JavaFX Script
class HelloWorld {
    var message : String;
    function print() { println(message);
  }
}
var name = "Jan";
var hello = HelloWorld {
    message: bind "Hello {name}!"
}
hello.print(); // prints Hello Jan!
name = "Brian";
hello.print(); // prints Hello Brian!
                                           12
Mobile vs. Desktop

                      k top       on
                 es             mm        ile
               D              Co       Mob



Common profile
Most of JavaFX is "common"
Different implementations
Platform specific APIs
Performance
Capabilities
                                                13
High level architecture
                    Java FX Application
 JavaFX Application Runtime

 JavaFX Language Runtime
                  SJWC: CLDC + MIDP + MSA

Application deployed as MIDlet
Full access to all JavaFX and device features
Language runtime is common for all profiles


                                                14
JavaFX Mobile Architecture

               JavaFX Runtime
     (Common API, SceneGraph, Media, Webservices)


     Sun Java Wireless Client
         (CLDC, MIDP 2.0, JSR 135)



   Software                   OpenVG                   OpenGL-ES
   Renderer


   Mobile Device

   Default Stack                2D Accelerated Stack   3D Accelerated Stack


                                                                              15
JavaFX Mobile - Packaging
                      JavaFX
                                                Java code
                       code



                    JavaFX compiler            Java compiler



 Pre-verification



                                                                Optionally bundled with
                                Static code analysis
      JAR                                                      JavaFX Platform Runtime
                               performance and size
(CLDC ready code)
                                   optimizations


                                                                                          16
Agenda
Introduction
End-to-end deployment: Moving JavaFX apps from
  Desktop to Mobile
JavaFX Mobile Do's and Dont's
Java ME integration: Co-mingling JavaFX code with
  Java ME
Demo: JavaFX Mobile running on cool devices




                                                    17
Moving JavaFX from Desktop to Mobile
Josh Marinacci's Tech Tip
  http://javafx.com/docs/techtips/mobile_sample/
Program only in Common Profile
  No use of Swing
  No use of Effects javafx.scene.effect
  No direct Java API calls
Keep screen size and orientation changeable
Allow for different Input Methods
  Keyboard vs. Touch Screen/Stylus
Keep in mind performance differences
Keep in mind graphics capabilities

                                                   18
Moving JavaFX from Desktop to Mobile
                         Desktop: Perspective Transform
                         Mouse clicks trigger action




Mobile: No tricky
transforms, Touch-
based or cursor key
trigger action, screen
size sensitive

                                                      19
Agenda
Introduction
End-to-end deployment: Moving JavaFX apps from
  Desktop to Mobile
JavaFX Mobile Do's and Dont's
Java ME integration: Co-mingling JavaFX code with
  Java ME
Demo: JavaFX Mobile running on cool devices




                                                    20
JavaFX Mobile Do's and Don'ts
                                     Do complex graphics off-line
Fancy graphics can be pre-rendered
                                     Add dynamic content (ex. text)
                                     at runtime




                                                                      21
JavaFX Mobile Do's and Don'ts
Michael Heinrichs' Mobile Best Practices:
  http://java.sun.com/developer/technicalArticles/javafx/mobile
Avoid unnecessary bindings
Keep the scenegraph small
Use simple shapes instead of images
Use pre-scaling
Use background loading
Use Integer instead of Number
Use functions of class Sequences



                                                                  22
Agenda
Introduction
End-to-end deployment: Moving JavaFX apps from
  Desktop to Mobile
JavaFX Mobile Do's and Dont's
Java ME integration: Co-mingling JavaFX code with
  Java ME
Demo: JavaFX Mobile running on cool devices




                                                    23
Java ME integration: Co-mingling
JavaFX code with Java ME
Will tie JavaFX app to Java ME platform (no cross-
 screen compatibility)
Access JSRs (optional functionality) on mobile devices
  Bluetooth
  GPS
  SMS text messaging
  etc.
One-way calls: JavaFX calling Java ME APIs
Use def whenever possible
Use Functions Outside Class

                                                         24
Java ME integration: Co-mingling
JavaFX code with Java ME
 import javax.microedition.*;
 ...
 def socket =
  Connector.open("socket://localhost:
  10001");
 def sc = socket as
  javax.microedition.io.SocketConnection
  ;

 def is = sc.openInputStream() as
  InputStream;
 def os = sc.openOutputStream() as
  OutputStream;                            25
Java ME integration: Co-mingling
JavaFX code with Java ME
 os.write(("connect:").getBytes());
 os.flush();

 os.write(("update:").getBytes());
 os.flush();

 os.close();
 sc.close();



                                      26
Co-mingling Bind of UI to the Controller

Java ME MIDP contains existing functionality
  (Controller) event code
Use of Bind in JavaFX
   Link attributes, so when one changes other
     automatic changes happen
Triggering from input events
   Bind JavaFX UI events to call MIDP code
Using data from MIDP
   JavaFX objects hold onto MIDP data to pass to
     MIDP when bind events occur


                                                   27
Co-mingling Bind UI to the Controller

Animations
Graphics Events
Transitions




                                        28
Co-mingling Bind of UI to the Controller

Example of Bind from JavaFX to MIDP:
Label {
   text: bind data.value
}
operation getCountFromMIDP( ) {
   ...
   // Use MIDP Java ME calls to get data
}




                                           29
Co-mingling JavaFX UI Event to Java
ME
var zipCodeText: TextBox = TextBox {
    blocksMouse: true
    columns: 7
    selectOnFocus: false
    text: "95054"
    onKeyPressed:function(e:KeyEvent) {
    if(e.code == KeyCode.VK_ENTER) {
      // Call Java ME APIs here
      // Ex. Get location-based services
      // ...
    }
}
                                           30
DEMO

JavaFX Mobile




                31
Q&A



February 10, 2010
Hinkmond Wong
Senior Staff Engineer
Sun Oracle

                        32
SVJFXUG – JavaFX Mobile Dojo



February 10, 2010

Hinkmond Wong
Senior Staff Engineer
Sun Oracle


                               33
Backup Slides




                34

Contenu connexe

Tendances

Java & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkJava & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkMohit Belwal
 
Sun Java EE 6 Overview
Sun Java EE 6 OverviewSun Java EE 6 Overview
Sun Java EE 6 Overviewsbobde
 
Understanding
Understanding Understanding
Understanding Arun Gupta
 
Lambda Expressions in Java | Java Lambda Tutorial | Java Certification Traini...
Lambda Expressions in Java | Java Lambda Tutorial | Java Certification Traini...Lambda Expressions in Java | Java Lambda Tutorial | Java Certification Traini...
Lambda Expressions in Java | Java Lambda Tutorial | Java Certification Traini...Edureka!
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Arun Gupta
 
108 advancedjava
108 advancedjava108 advancedjava
108 advancedjavaAnil Kumar
 
Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...
Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...
Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...Edureka!
 
Java Enterprise Edition 6 Overview
Java Enterprise Edition 6 OverviewJava Enterprise Edition 6 Overview
Java Enterprise Edition 6 OverviewEugene Bogaart
 
JavaFX 2 Using the Spring Framework
JavaFX 2 Using the Spring FrameworkJavaFX 2 Using the Spring Framework
JavaFX 2 Using the Spring FrameworkStephen Chin
 
JEE Course - JEE Overview
JEE Course - JEE  OverviewJEE Course - JEE  Overview
JEE Course - JEE Overviewodedns
 
Java EE 6 Component Model Explained
Java EE 6 Component Model Explained Java EE 6 Component Model Explained
Java EE 6 Component Model Explained Shreedhar Ganapathy
 
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011Arun Gupta
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGMarakana Inc.
 
Java EE6 CodeCamp16 oct 2010
Java EE6 CodeCamp16 oct 2010Java EE6 CodeCamp16 oct 2010
Java EE6 CodeCamp16 oct 2010Codecamp Romania
 
GlassFish OSGi Server
GlassFish OSGi ServerGlassFish OSGi Server
GlassFish OSGi ServerArtur Alves
 
Java EE 6 & GlassFish 3
Java EE 6 & GlassFish 3Java EE 6 & GlassFish 3
Java EE 6 & GlassFish 3Arun Gupta
 
Running your Java EE applications in the Cloud
Running your Java EE applications in the CloudRunning your Java EE applications in the Cloud
Running your Java EE applications in the CloudArun Gupta
 

Tendances (20)

Java & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkJava & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate Framework
 
Sun Java EE 6 Overview
Sun Java EE 6 OverviewSun Java EE 6 Overview
Sun Java EE 6 Overview
 
Understanding
Understanding Understanding
Understanding
 
Lambda Expressions in Java | Java Lambda Tutorial | Java Certification Traini...
Lambda Expressions in Java | Java Lambda Tutorial | Java Certification Traini...Lambda Expressions in Java | Java Lambda Tutorial | Java Certification Traini...
Lambda Expressions in Java | Java Lambda Tutorial | Java Certification Traini...
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011
 
108 advancedjava
108 advancedjava108 advancedjava
108 advancedjava
 
Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...
Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...
Java Tutorial For Beginners - Step By Step | Java Basics | Java Certification...
 
Java Enterprise Edition 6 Overview
Java Enterprise Edition 6 OverviewJava Enterprise Edition 6 Overview
Java Enterprise Edition 6 Overview
 
Java 7 workshop
Java 7 workshopJava 7 workshop
Java 7 workshop
 
JavaFX 2 Using the Spring Framework
JavaFX 2 Using the Spring FrameworkJavaFX 2 Using the Spring Framework
JavaFX 2 Using the Spring Framework
 
JEE Course - JEE Overview
JEE Course - JEE  OverviewJEE Course - JEE  Overview
JEE Course - JEE Overview
 
Java EE 6 Component Model Explained
Java EE 6 Component Model Explained Java EE 6 Component Model Explained
Java EE 6 Component Model Explained
 
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUG
 
Java EE6 CodeCamp16 oct 2010
Java EE6 CodeCamp16 oct 2010Java EE6 CodeCamp16 oct 2010
Java EE6 CodeCamp16 oct 2010
 
GlassFish OSGi Server
GlassFish OSGi ServerGlassFish OSGi Server
GlassFish OSGi Server
 
Java EE 6 & GlassFish 3
Java EE 6 & GlassFish 3Java EE 6 & GlassFish 3
Java EE 6 & GlassFish 3
 
Java EE 8
Java EE 8Java EE 8
Java EE 8
 
Running your Java EE applications in the Cloud
Running your Java EE applications in the CloudRunning your Java EE applications in the Cloud
Running your Java EE applications in the Cloud
 
Java 1
Java 1Java 1
Java 1
 

En vedette

Ceam conferecia taller 12 nov 2010 errores bmix
Ceam conferecia taller 12 nov 2010 errores bmixCeam conferecia taller 12 nov 2010 errores bmix
Ceam conferecia taller 12 nov 2010 errores bmixCEAM UFRO
 
Look to you spanish
Look to you   spanishLook to you   spanish
Look to you spanishcamilo
 
Infecciones respiratorias virales
Infecciones respiratorias viralesInfecciones respiratorias virales
Infecciones respiratorias viralesdegarden
 
Alberto rubio sanchez, rousseau
Alberto rubio sanchez, rousseauAlberto rubio sanchez, rousseau
Alberto rubio sanchez, rousseaurubiogamo10
 
De la ocupación a la cooperativa: el proceso de recuperación de empresas en l...
De la ocupación a la cooperativa: el proceso de recuperación de empresas en l...De la ocupación a la cooperativa: el proceso de recuperación de empresas en l...
De la ocupación a la cooperativa: el proceso de recuperación de empresas en l...EOI Escuela de Organización Industrial
 
Eada Spirit 06
Eada Spirit 06Eada Spirit 06
Eada Spirit 06EADA
 
Demo curso-tcp-ip
Demo curso-tcp-ipDemo curso-tcp-ip
Demo curso-tcp-ipCarlosRPC
 
El argentino n# 2633 10 5-121
El argentino n# 2633 10 5-121El argentino n# 2633 10 5-121
El argentino n# 2633 10 5-121diarioelargentino
 
Office365 y la productidad en la nube
Office365 y la productidad en la nubeOffice365 y la productidad en la nube
Office365 y la productidad en la nubewww.encamina.com
 
Ausstellung Lichtfeld 7 Presseinformation
Ausstellung Lichtfeld 7 PresseinformationAusstellung Lichtfeld 7 Presseinformation
Ausstellung Lichtfeld 7 PresseinformationPatrik Tschudin
 
Acervo bibliotecologia escalas_escala_de_likert
Acervo bibliotecologia escalas_escala_de_likertAcervo bibliotecologia escalas_escala_de_likert
Acervo bibliotecologia escalas_escala_de_likertHelel Larea
 
Sustainability Drinks #18 - Volksentscheid Fahrrad
Sustainability Drinks #18 - Volksentscheid FahrradSustainability Drinks #18 - Volksentscheid Fahrrad
Sustainability Drinks #18 - Volksentscheid FahrradGreenBuzz Berlin
 

En vedette (20)

Ceam conferecia taller 12 nov 2010 errores bmix
Ceam conferecia taller 12 nov 2010 errores bmixCeam conferecia taller 12 nov 2010 errores bmix
Ceam conferecia taller 12 nov 2010 errores bmix
 
Look to you spanish
Look to you   spanishLook to you   spanish
Look to you spanish
 
Paula Menna Barreto Hall
Paula Menna Barreto HallPaula Menna Barreto Hall
Paula Menna Barreto Hall
 
Infecciones respiratorias virales
Infecciones respiratorias viralesInfecciones respiratorias virales
Infecciones respiratorias virales
 
Alberto rubio sanchez, rousseau
Alberto rubio sanchez, rousseauAlberto rubio sanchez, rousseau
Alberto rubio sanchez, rousseau
 
De la ocupación a la cooperativa: el proceso de recuperación de empresas en l...
De la ocupación a la cooperativa: el proceso de recuperación de empresas en l...De la ocupación a la cooperativa: el proceso de recuperación de empresas en l...
De la ocupación a la cooperativa: el proceso de recuperación de empresas en l...
 
Pdf internet
Pdf internetPdf internet
Pdf internet
 
Eada Spirit 06
Eada Spirit 06Eada Spirit 06
Eada Spirit 06
 
Demo curso-tcp-ip
Demo curso-tcp-ipDemo curso-tcp-ip
Demo curso-tcp-ip
 
El argentino n# 2633 10 5-121
El argentino n# 2633 10 5-121El argentino n# 2633 10 5-121
El argentino n# 2633 10 5-121
 
Ec4333 Lecture 1
Ec4333 Lecture 1Ec4333 Lecture 1
Ec4333 Lecture 1
 
Canciiones
CanciionesCanciiones
Canciiones
 
Office365 y la productidad en la nube
Office365 y la productidad en la nubeOffice365 y la productidad en la nube
Office365 y la productidad en la nube
 
Ausstellung Lichtfeld 7 Presseinformation
Ausstellung Lichtfeld 7 PresseinformationAusstellung Lichtfeld 7 Presseinformation
Ausstellung Lichtfeld 7 Presseinformation
 
Ict executive summary template
Ict   executive summary templateIct   executive summary template
Ict executive summary template
 
Acervo bibliotecologia escalas_escala_de_likert
Acervo bibliotecologia escalas_escala_de_likertAcervo bibliotecologia escalas_escala_de_likert
Acervo bibliotecologia escalas_escala_de_likert
 
Viacom
ViacomViacom
Viacom
 
Sustainability Drinks #18 - Volksentscheid Fahrrad
Sustainability Drinks #18 - Volksentscheid FahrradSustainability Drinks #18 - Volksentscheid Fahrrad
Sustainability Drinks #18 - Volksentscheid Fahrrad
 
arysahulatbazar
arysahulatbazararysahulatbazar
arysahulatbazar
 
Vr ma - MM - LMS 59
Vr ma - MM - LMS 59Vr ma - MM - LMS 59
Vr ma - MM - LMS 59
 

Similaire à Hinkmond's JavaFX Mobile Dojo

Complete Solution for JavaFX Development - NexSoftSys
Complete Solution for JavaFX Development - NexSoftSysComplete Solution for JavaFX Development - NexSoftSys
Complete Solution for JavaFX Development - NexSoftSysNexSoftsys
 
JavaFX: A Rich Internet Application (RIA) Development Platform
JavaFX: A Rich Internet Application (RIA) Development PlatformJavaFX: A Rich Internet Application (RIA) Development Platform
JavaFX: A Rich Internet Application (RIA) Development PlatformPraveen Srivastava
 
Java keynote preso
Java keynote presoJava keynote preso
Java keynote presoArtur Alves
 
Java for Recruiters
Java for RecruitersJava for Recruiters
Java for Recruitersph7 -
 
JavaOne - The JavaFX Community and Ecosystem
JavaOne - The JavaFX Community and EcosystemJavaOne - The JavaFX Community and Ecosystem
JavaOne - The JavaFX Community and EcosystemAlexander Casall
 
JRE , JDK and platform independent nature of JAVA
JRE , JDK and platform independent nature of JAVAJRE , JDK and platform independent nature of JAVA
JRE , JDK and platform independent nature of JAVAMehak Tawakley
 
JavaFX 8 everywhere; write once run anywhere by Mohamed Taman
JavaFX 8 everywhere; write once run anywhere by Mohamed TamanJavaFX 8 everywhere; write once run anywhere by Mohamed Taman
JavaFX 8 everywhere; write once run anywhere by Mohamed TamanJavaDayUA
 
Great cup of java
Great  cup of javaGreat  cup of java
Great cup of javaCIB Egypt
 
The Brainify App - JavaFx
The Brainify App - JavaFxThe Brainify App - JavaFx
The Brainify App - JavaFxMohd Shamweel
 
Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1rajivmordani
 
Netbeans
NetbeansNetbeans
Netbeansacosdt
 

Similaire à Hinkmond's JavaFX Mobile Dojo (20)

Complete Solution for JavaFX Development - NexSoftSys
Complete Solution for JavaFX Development - NexSoftSysComplete Solution for JavaFX Development - NexSoftSys
Complete Solution for JavaFX Development - NexSoftSys
 
JavaFX: A Rich Internet Application (RIA) Development Platform
JavaFX: A Rich Internet Application (RIA) Development PlatformJavaFX: A Rich Internet Application (RIA) Development Platform
JavaFX: A Rich Internet Application (RIA) Development Platform
 
Java keynote preso
Java keynote presoJava keynote preso
Java keynote preso
 
Java for Recruiters
Java for RecruitersJava for Recruiters
Java for Recruiters
 
JavaOne - The JavaFX Community and Ecosystem
JavaOne - The JavaFX Community and EcosystemJavaOne - The JavaFX Community and Ecosystem
JavaOne - The JavaFX Community and Ecosystem
 
JRE , JDK and platform independent nature of JAVA
JRE , JDK and platform independent nature of JAVAJRE , JDK and platform independent nature of JAVA
JRE , JDK and platform independent nature of JAVA
 
Java Intro
Java IntroJava Intro
Java Intro
 
Java - At a glance
Java - At a glanceJava - At a glance
Java - At a glance
 
java basics.pptx
java basics.pptxjava basics.pptx
java basics.pptx
 
Presentation on Java Basic
Presentation on Java BasicPresentation on Java Basic
Presentation on Java Basic
 
JavaFX 8 everywhere; write once run anywhere by Mohamed Taman
JavaFX 8 everywhere; write once run anywhere by Mohamed TamanJavaFX 8 everywhere; write once run anywhere by Mohamed Taman
JavaFX 8 everywhere; write once run anywhere by Mohamed Taman
 
Great cup of java
Great  cup of javaGreat  cup of java
Great cup of java
 
The Brainify App - JavaFx
The Brainify App - JavaFxThe Brainify App - JavaFx
The Brainify App - JavaFx
 
Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1
 
Mobile Java
Mobile JavaMobile Java
Mobile Java
 
Java fx
Java fxJava fx
Java fx
 
Core Java-1 (1).pdf
Core Java-1 (1).pdfCore Java-1 (1).pdf
Core Java-1 (1).pdf
 
Netbeans
NetbeansNetbeans
Netbeans
 
What is java fx?
What is java fx?What is java fx?
What is java fx?
 
Javafx
JavafxJavafx
Javafx
 

Plus de Stephen Chin

DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2Stephen Chin
 
10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java Community10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java CommunityStephen Chin
 
Java Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive GuideJava Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive GuideStephen Chin
 
DevOps Tools for Java Developers
DevOps Tools for Java DevelopersDevOps Tools for Java Developers
DevOps Tools for Java DevelopersStephen Chin
 
Java Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJCJava Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJCStephen Chin
 
RetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming ConsoleRetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming ConsoleStephen Chin
 
JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)Stephen Chin
 
Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)Stephen Chin
 
Devoxx4Kids Lego Workshop
Devoxx4Kids Lego WorkshopDevoxx4Kids Lego Workshop
Devoxx4Kids Lego WorkshopStephen Chin
 
Raspberry Pi with Java (JJUG)
Raspberry Pi with Java (JJUG)Raspberry Pi with Java (JJUG)
Raspberry Pi with Java (JJUG)Stephen Chin
 
Confessions of a Former Agile Methodologist
Confessions of a Former Agile MethodologistConfessions of a Former Agile Methodologist
Confessions of a Former Agile MethodologistStephen Chin
 
Internet of Things Magic Show
Internet of Things Magic ShowInternet of Things Magic Show
Internet of Things Magic ShowStephen Chin
 
Zombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the UndeadZombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the UndeadStephen Chin
 
JCrete Embedded Java Workshop
JCrete Embedded Java WorkshopJCrete Embedded Java Workshop
JCrete Embedded Java WorkshopStephen Chin
 
Oracle IoT Kids Workshop
Oracle IoT Kids WorkshopOracle IoT Kids Workshop
Oracle IoT Kids WorkshopStephen Chin
 
OpenJFX on Android and Devices
OpenJFX on Android and DevicesOpenJFX on Android and Devices
OpenJFX on Android and DevicesStephen Chin
 
Java on Raspberry Pi Lab
Java on Raspberry Pi LabJava on Raspberry Pi Lab
Java on Raspberry Pi LabStephen Chin
 
Java 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and LegosJava 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and LegosStephen Chin
 
Devoxx4Kids NAO Workshop
Devoxx4Kids NAO WorkshopDevoxx4Kids NAO Workshop
Devoxx4Kids NAO WorkshopStephen Chin
 

Plus de Stephen Chin (20)

DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2DevOps Tools for Java Developers v2
DevOps Tools for Java Developers v2
 
10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java Community10 Ways Everyone Can Support the Java Community
10 Ways Everyone Can Support the Java Community
 
Java Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive GuideJava Clients and JavaFX: The Definitive Guide
Java Clients and JavaFX: The Definitive Guide
 
DevOps Tools for Java Developers
DevOps Tools for Java DevelopersDevOps Tools for Java Developers
DevOps Tools for Java Developers
 
Java Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJCJava Clients and JavaFX - Presented to LJC
Java Clients and JavaFX - Presented to LJC
 
RetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming ConsoleRetroPi Handheld Raspberry Pi Gaming Console
RetroPi Handheld Raspberry Pi Gaming Console
 
JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)JavaFX on Mobile (by Johan Vos)
JavaFX on Mobile (by Johan Vos)
 
Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)Confessions of a Former Agile Methodologist (JFrog Edition)
Confessions of a Former Agile Methodologist (JFrog Edition)
 
Devoxx4Kids Lego Workshop
Devoxx4Kids Lego WorkshopDevoxx4Kids Lego Workshop
Devoxx4Kids Lego Workshop
 
Raspberry Pi with Java (JJUG)
Raspberry Pi with Java (JJUG)Raspberry Pi with Java (JJUG)
Raspberry Pi with Java (JJUG)
 
Confessions of a Former Agile Methodologist
Confessions of a Former Agile MethodologistConfessions of a Former Agile Methodologist
Confessions of a Former Agile Methodologist
 
Internet of Things Magic Show
Internet of Things Magic ShowInternet of Things Magic Show
Internet of Things Magic Show
 
Zombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the UndeadZombie Time - JSR 310 for the Undead
Zombie Time - JSR 310 for the Undead
 
JCrete Embedded Java Workshop
JCrete Embedded Java WorkshopJCrete Embedded Java Workshop
JCrete Embedded Java Workshop
 
Oracle IoT Kids Workshop
Oracle IoT Kids WorkshopOracle IoT Kids Workshop
Oracle IoT Kids Workshop
 
OpenJFX on Android and Devices
OpenJFX on Android and DevicesOpenJFX on Android and Devices
OpenJFX on Android and Devices
 
Java on Raspberry Pi Lab
Java on Raspberry Pi LabJava on Raspberry Pi Lab
Java on Raspberry Pi Lab
 
Java 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and LegosJava 8 for Tablets, Pis, and Legos
Java 8 for Tablets, Pis, and Legos
 
DukeScript
DukeScriptDukeScript
DukeScript
 
Devoxx4Kids NAO Workshop
Devoxx4Kids NAO WorkshopDevoxx4Kids NAO Workshop
Devoxx4Kids NAO Workshop
 

Dernier

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 

Dernier (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 

Hinkmond's JavaFX Mobile Dojo

  • 1. SVJFXUG – JavaFX Mobile Dojo February 10, 2010 Hinkmond Wong Senior Staff Engineer Sun Oracle 1
  • 2. Agenda Introduction End-to-end deployment: Moving JavaFX apps from Desktop to Mobile JavaFX Mobile Do's and Dont's Java ME integration: Co-mingling JavaFX code with Java ME Demo: JavaFX Mobile running on cool devices Q&A 2
  • 3. Agenda Introduction End-to-end deployment: Moving JavaFX apps from Desktop to Mobile JavaFX Mobile Do's and Dont's Java ME integration: Co-mingling JavaFX code with Java ME Demo: JavaFX Mobile running on cool devices 3
  • 4. JavaFX: Simple, Declarative Scripting Language class HelloWorld { var message : String; function print() { println(message); } } var name = "Jan"; var hello = HelloWorld { message: bind "Hello {name}!" } hello.print(); // prints Hello Jan! name = "Brian"; hello.print(); // prints Hello Brian! 4
  • 5. JavaFX Scenegraph Tree-like structure of graphical nodes Easy way of vector graphics representation Scene { Group { javafx.scene.shape Rectangle, Rectangle Circle } } javafx.scene.shape Circle 5
  • 6. JavaFX Block Diagram JavaFX Applications and Services JavaFX Apps Framework Authoring Tools JavaFX JavaFX JavaFX Desktop Mobile TV Developer Runtime Runtime Runtime Tools (IDE Plug ins, RAD, Production Suite) Desktop Mobile TV Extensions Extensions Extensions Designer Tools JavaFX Common Profile (Authoring, Publishing, Media Encoding) Java Platform (Java Plug in) 6
  • 7. JavaFX Common Profile Features Components Features Compiler and Languages SE 5 and CLDC Target Geometric shapes, lines, Clip with arbitrary geometric shapes curves, arc Image masks Graphics Transparency Fullscreen support Gradient, color fill, texture transforms (rotate, scale skew) Stroke styles True Type font rendering Text Transforms (rotate, scale, skew) Content embedded font 7
  • 8. JavaFX Common Profile Features Components Features Key frame animation Standard animations Animation with tweening (rotate, zoom, slide) Path-based animation Cross platform audio (mp3) Volume and audio balance control and video (On2) Media Codec native media framework support (DirectShow and Core Video), play, pause, seek, volume, balance, speed controls Web services (JSON/XML parser, RESTful APIs) Other Common text input control (CSS skinning) Input handling (keyboard, mouse, touch, etc.) 8
  • 9. JavaFX Developer Tool Chain Media Assets Assets Integrated Emulated By Created By Transformed By Into IDEs (If Required) Adobe Illustrator JavaFX Plug-in Adobe for IDEs Photoshop JavaFX JavaFX Production Mobile Suite JavaFX Emulator On2 Flix Compiler Encoders (JavaFX File Format, VP6 and MP3) Adobe CS3 (Flash and 3rd Party Flash Video, JavaFX 1.5) RAD Tool 9
  • 10. JavaFX Plugin for NetBeans 10
  • 11. Incorporate Existing Visual Assets with JavaFX Production Suite 11
  • 12. JavaFX Script class HelloWorld { var message : String; function print() { println(message); } } var name = "Jan"; var hello = HelloWorld { message: bind "Hello {name}!" } hello.print(); // prints Hello Jan! name = "Brian"; hello.print(); // prints Hello Brian! 12
  • 13. Mobile vs. Desktop k top on es mm ile D Co Mob Common profile Most of JavaFX is "common" Different implementations Platform specific APIs Performance Capabilities 13
  • 14. High level architecture Java FX Application JavaFX Application Runtime JavaFX Language Runtime SJWC: CLDC + MIDP + MSA Application deployed as MIDlet Full access to all JavaFX and device features Language runtime is common for all profiles 14
  • 15. JavaFX Mobile Architecture JavaFX Runtime (Common API, SceneGraph, Media, Webservices) Sun Java Wireless Client (CLDC, MIDP 2.0, JSR 135) Software OpenVG OpenGL-ES Renderer Mobile Device Default Stack 2D Accelerated Stack 3D Accelerated Stack 15
  • 16. JavaFX Mobile - Packaging JavaFX Java code code JavaFX compiler Java compiler Pre-verification Optionally bundled with Static code analysis JAR JavaFX Platform Runtime performance and size (CLDC ready code) optimizations 16
  • 17. Agenda Introduction End-to-end deployment: Moving JavaFX apps from Desktop to Mobile JavaFX Mobile Do's and Dont's Java ME integration: Co-mingling JavaFX code with Java ME Demo: JavaFX Mobile running on cool devices 17
  • 18. Moving JavaFX from Desktop to Mobile Josh Marinacci's Tech Tip http://javafx.com/docs/techtips/mobile_sample/ Program only in Common Profile No use of Swing No use of Effects javafx.scene.effect No direct Java API calls Keep screen size and orientation changeable Allow for different Input Methods Keyboard vs. Touch Screen/Stylus Keep in mind performance differences Keep in mind graphics capabilities 18
  • 19. Moving JavaFX from Desktop to Mobile Desktop: Perspective Transform Mouse clicks trigger action Mobile: No tricky transforms, Touch- based or cursor key trigger action, screen size sensitive 19
  • 20. Agenda Introduction End-to-end deployment: Moving JavaFX apps from Desktop to Mobile JavaFX Mobile Do's and Dont's Java ME integration: Co-mingling JavaFX code with Java ME Demo: JavaFX Mobile running on cool devices 20
  • 21. JavaFX Mobile Do's and Don'ts Do complex graphics off-line Fancy graphics can be pre-rendered Add dynamic content (ex. text) at runtime 21
  • 22. JavaFX Mobile Do's and Don'ts Michael Heinrichs' Mobile Best Practices: http://java.sun.com/developer/technicalArticles/javafx/mobile Avoid unnecessary bindings Keep the scenegraph small Use simple shapes instead of images Use pre-scaling Use background loading Use Integer instead of Number Use functions of class Sequences 22
  • 23. Agenda Introduction End-to-end deployment: Moving JavaFX apps from Desktop to Mobile JavaFX Mobile Do's and Dont's Java ME integration: Co-mingling JavaFX code with Java ME Demo: JavaFX Mobile running on cool devices 23
  • 24. Java ME integration: Co-mingling JavaFX code with Java ME Will tie JavaFX app to Java ME platform (no cross- screen compatibility) Access JSRs (optional functionality) on mobile devices Bluetooth GPS SMS text messaging etc. One-way calls: JavaFX calling Java ME APIs Use def whenever possible Use Functions Outside Class 24
  • 25. Java ME integration: Co-mingling JavaFX code with Java ME import javax.microedition.*; ... def socket = Connector.open("socket://localhost: 10001"); def sc = socket as javax.microedition.io.SocketConnection ; def is = sc.openInputStream() as InputStream; def os = sc.openOutputStream() as OutputStream; 25
  • 26. Java ME integration: Co-mingling JavaFX code with Java ME os.write(("connect:").getBytes()); os.flush(); os.write(("update:").getBytes()); os.flush(); os.close(); sc.close(); 26
  • 27. Co-mingling Bind of UI to the Controller Java ME MIDP contains existing functionality (Controller) event code Use of Bind in JavaFX Link attributes, so when one changes other automatic changes happen Triggering from input events Bind JavaFX UI events to call MIDP code Using data from MIDP JavaFX objects hold onto MIDP data to pass to MIDP when bind events occur 27
  • 28. Co-mingling Bind UI to the Controller Animations Graphics Events Transitions 28
  • 29. Co-mingling Bind of UI to the Controller Example of Bind from JavaFX to MIDP: Label { text: bind data.value } operation getCountFromMIDP( ) { ... // Use MIDP Java ME calls to get data } 29
  • 30. Co-mingling JavaFX UI Event to Java ME var zipCodeText: TextBox = TextBox { blocksMouse: true columns: 7 selectOnFocus: false text: "95054" onKeyPressed:function(e:KeyEvent) { if(e.code == KeyCode.VK_ENTER) { // Call Java ME APIs here // Ex. Get location-based services // ... } } 30
  • 32. Q&A February 10, 2010 Hinkmond Wong Senior Staff Engineer Sun Oracle 32
  • 33. SVJFXUG – JavaFX Mobile Dojo February 10, 2010 Hinkmond Wong Senior Staff Engineer Sun Oracle 33