SlideShare ist ein Scribd-Unternehmen logo
1 von 34
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Understanding
Understanding Understanding
Understanding
Arun Gupta
 
108 advancedjava
108 advancedjava108 advancedjava
108 advancedjava
Anil Kumar
 
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
 
Java EE6 CodeCamp16 oct 2010
Java EE6 CodeCamp16 oct 2010Java EE6 CodeCamp16 oct 2010
Java EE6 CodeCamp16 oct 2010
Codecamp Romania
 

Was ist angesagt? (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
 

Andere mochten auch

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
CEAM UFRO
 
Look to you spanish
Look to you   spanishLook to you   spanish
Look to you spanish
camilo
 
Infecciones respiratorias virales
Infecciones respiratorias viralesInfecciones respiratorias virales
Infecciones respiratorias virales
degarden
 
Alberto rubio sanchez, rousseau
Alberto rubio sanchez, rousseauAlberto rubio sanchez, rousseau
Alberto rubio sanchez, rousseau
rubiogamo10
 
Demo curso-tcp-ip
Demo curso-tcp-ipDemo curso-tcp-ip
Demo curso-tcp-ip
CarlosRPC
 
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
diarioelargentino
 
Acervo bibliotecologia escalas_escala_de_likert
Acervo bibliotecologia escalas_escala_de_likertAcervo bibliotecologia escalas_escala_de_likert
Acervo bibliotecologia escalas_escala_de_likert
Helel Larea
 

Andere mochten auch (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
 

Ähnlich wie Hinkmond's JavaFX Mobile Dojo

Java for Recruiters
Java for RecruitersJava for Recruiters
Java for Recruiters
ph7 -
 
Presentation on Java Basic
Presentation on Java BasicPresentation on Java Basic
Presentation on Java Basic
Rustamji Institute of Technology
 
Great cup of java
Great  cup of javaGreat  cup of java
Great cup of java
CIB Egypt
 
The Brainify App - JavaFx
The Brainify App - JavaFxThe Brainify App - JavaFx
The Brainify App - JavaFx
Mohd Shamweel
 
Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1Java Fx Ajaxworld Rags V1
Java Fx Ajaxworld Rags V1
rajivmordani
 
Netbeans
NetbeansNetbeans
Netbeans
acosdt
 

Ähnlich wie 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
 

Mehr von Stephen Chin

Mehr von 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
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

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