SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Using multi-touch and sensors
in Java

Felipe Pedroso
Agenda

• The future of PCs
• JavaFX and Touch Support
• Using JNI to work with sensors

2
Mobile Computing Lines are Blurring
Smartphone

Consumption Usages

Tablet

Ultrabook™
Convertible & Detachable

Ultrabook™

Creation/Productivity

Notebook
Reshaping the PC Experience
Multi-Touch
Accelerometer

Ambient
Light Sensor

Ultrabook™

Compass

GPS

Gyroscope

Near Field
Communication

Context Aware
Sensors
4
OK, they have all those
features…
… but how can we implement them using Java?
To allow users to TOUCH my Java App...
• Should I use...
• AWT?
• Swing?
• SWT?

• Actually, you can use them but...
• They aren’t made for multi-touch (OK, there’s a way to do it)
• You must optimize your UI controls to be more ‘touch friendly’

• So, how to do it in a simple and easy way?

6
7
Actions supported
• Touch events: Down, Move and Up
• Tap (Down and Up) / Double tap
• Drag and Drop (Down, Move and Up)
• Hold

• Gestures
• Swipe: Up, Down, Left and Right
• Zoom: Pinch / Spread
• Rotate

8
What I need to do to manipulate components?
• Your components must extend the Node class or any of its
subclasses (StackPane, ImageView, etc)
• Set the proper EventHandler to handle the action.

9
What I need to do to manipulate components?
• Apply a transform to the component (Translation, Rotation and
Scale):

• Let’s dive into some code!

10
What about the sensors?

JNI, I choose you!
Available sensors on Ultrabooks
• Accelerometer
• Proper acceleration in three axis (x, y, z)

• Gyrometer
• Device orientation

• Magnetometer
• Strenght and direction of magnetic fields

• GPS (Global Positioning System)
• Location and Time information

• NFC
• Near Field Communication

• Ambient Light Sensor
• Ambient Light Level

12
API Windows – Sensor Fusion

13
API Windows – Namespaces
• Windows.Sensors.*  Common sensors
•
•
•
•
•
•
•

Accelerometer
Gyrometer
Inclinometer
OrientationSensor
SimpleOrientationSensor
Compass
LightSensor

• Windows.Devices.Geolocation

 GPS

• Geolocator

• Windows.Networking.Proximity  NFC
• ProximityDevice

14
Windows API – How to
• Get the default object of your sensor using the GetDefault method
• You can call the GetCurrentReading() to get the current value of the
sensors or...
• ... work with the ReadingChanged event
• Set the attribute ReportInterval (please, respect the MinimumReportInterval to avoid problems)
• Delegate a method to handle the event (something like setting a method as a listener)
• Handle the event!

• This procedure is valid only for sensors from Windows.Sensors
namespace

15
How can I access that?

16
Using JNI to access the sensors from
Windows.Sensors
1. [Java] Create a native method to register the object that will
handle the events that come from the sensor
2. Generate the header file using javah

3. [C++] Create a DLL Project in Visual Studio with the DLLs
and namespaces of the Windows 8 APIS
4. [C++] Use a variable to keep a reference to the object and
the ID (GetMethodID) of the method that will handle the
event
17
Using JNI to access the sensors from
Windows.Sensors
5. [C++] Initialize the sensor and delegate a C++ method to
handle the event
6. [C++] Redirect the delegate method call to the Java method
using the function CallVoidMethod with the following
parameters: the Java Object, the method ID and it’s
parameters
7. [Java] Handle the event! 
A lot of text? Please, show me the code!
18
What about Linux?
• Touch works fine, but there aren’t clear APIs to read
sensors. If you know how to do it, let’s work together!

19
Wants to know more about Intel Software?
http://software.intel.com/pt-br/

20
Windows Community
http://software.intel.com/en-us/windows

21
www.javafxcommunity.com

22
JFXtras.org

23
Take aways
• The PC experience is being reshaped
• JavaFX + Touch = AWESOME

• Using JNI to access the sensors can be LEGENDARY!
Any doubts?
(if yes, the answer is 42)
Thanks a lot!
Felipe Pedroso
facebook.com/felipe.a.pedroso
@felipeapedroso

Weitere ähnliche Inhalte

Was ist angesagt?

Sit microsoft kinect
Sit  microsoft kinectSit  microsoft kinect
Sit microsoft kinectrallen05
 
Event Touch / Gestures
Event Touch / GesturesEvent Touch / Gestures
Event Touch / GesturesESUG
 
Pradeep6th sence
Pradeep6th sencePradeep6th sence
Pradeep6th senceRam Sita
 
Virtual keyboard
Virtual keyboardVirtual keyboard
Virtual keyboardPayal Payal
 
Scanning text and images using scanner
Scanning text and images using scannerScanning text and images using scanner
Scanning text and images using scannerMukesh Mirrey
 
Virtual keyboard
Virtual keyboardVirtual keyboard
Virtual keyboardNikhil Vyas
 
Augmented Reality with the Intel® RealSense™ SDK and R200 Camera
Augmented Reality with the Intel® RealSense™ SDK and R200 CameraAugmented Reality with the Intel® RealSense™ SDK and R200 Camera
Augmented Reality with the Intel® RealSense™ SDK and R200 CameraIntel® Software
 

Was ist angesagt? (14)

Sit microsoft kinect
Sit  microsoft kinectSit  microsoft kinect
Sit microsoft kinect
 
Event Touch / Gestures
Event Touch / GesturesEvent Touch / Gestures
Event Touch / Gestures
 
Smart note
Smart noteSmart note
Smart note
 
Virtual Keyboard
Virtual KeyboardVirtual Keyboard
Virtual Keyboard
 
Pradeep6th sence
Pradeep6th sencePradeep6th sence
Pradeep6th sence
 
Virtual Keyboard
Virtual KeyboardVirtual Keyboard
Virtual Keyboard
 
Intel real sense handson
Intel real sense handsonIntel real sense handson
Intel real sense handson
 
Final
FinalFinal
Final
 
Virtual keyboard
Virtual keyboardVirtual keyboard
Virtual keyboard
 
Scanning text and images using scanner
Scanning text and images using scannerScanning text and images using scanner
Scanning text and images using scanner
 
Virtual keyboard
Virtual keyboardVirtual keyboard
Virtual keyboard
 
Sixth sense technology
Sixth sense technologySixth sense technology
Sixth sense technology
 
Virtual keyboard
Virtual keyboardVirtual keyboard
Virtual keyboard
 
Augmented Reality with the Intel® RealSense™ SDK and R200 Camera
Augmented Reality with the Intel® RealSense™ SDK and R200 CameraAugmented Reality with the Intel® RealSense™ SDK and R200 Camera
Augmented Reality with the Intel® RealSense™ SDK and R200 Camera
 

Ähnlich wie Using multitouch and sensors in Java

Developing Rich Interfaces in JavaFX for Ultrabooks
Developing Rich Interfaces in JavaFX for UltrabooksDeveloping Rich Interfaces in JavaFX for Ultrabooks
Developing Rich Interfaces in JavaFX for UltrabooksFelipe Pedroso
 
Developing Rich Interfaces in JavaFX for Ultrabooks
Developing Rich Interfaces in JavaFX for UltrabooksDeveloping Rich Interfaces in JavaFX for Ultrabooks
Developing Rich Interfaces in JavaFX for UltrabooksBruno Borges
 
virtual reality Information-160422181930.pdf
virtual reality Information-160422181930.pdfvirtual reality Information-160422181930.pdf
virtual reality Information-160422181930.pdf21107117
 
A computer vision based virtual mouse
A computer vision based virtual mouseA computer vision based virtual mouse
A computer vision based virtual mouseStudentRocks
 
Sixth sense technology ppt
Sixth sense technology pptSixth sense technology ppt
Sixth sense technology pptMohammad Adil
 
Sixth sense techno_ppt
Sixth sense techno_pptSixth sense techno_ppt
Sixth sense techno_pptPALAK_SINGH
 
Postmortem of a uwp xaml application development
Postmortem of a uwp xaml application developmentPostmortem of a uwp xaml application development
Postmortem of a uwp xaml application developmentDavid Catuhe
 
Everything About Android - Itvedant, Thane | Mumbai | Navi Mumbai
Everything About Android - Itvedant, Thane | Mumbai | Navi Mumbai Everything About Android - Itvedant, Thane | Mumbai | Navi Mumbai
Everything About Android - Itvedant, Thane | Mumbai | Navi Mumbai Itvedant
 
Touchless touchscreen technology
Touchless touchscreen technologyTouchless touchscreen technology
Touchless touchscreen technologyMATHEW JOSEPH
 
Touchless touchscreen technology
Touchless touchscreen technologyTouchless touchscreen technology
Touchless touchscreen technologyMATHEW JOSEPH
 
Mobile AR Lecture 10 - Research Directions
Mobile AR Lecture 10 - Research DirectionsMobile AR Lecture 10 - Research Directions
Mobile AR Lecture 10 - Research DirectionsMark Billinghurst
 
Touchless Touchscreen Technology
Touchless Touchscreen TechnologyTouchless Touchscreen Technology
Touchless Touchscreen TechnologyAkshay Vasava
 
Android Programming Basic
Android Programming BasicAndroid Programming Basic
Android Programming BasicDuy Do Phan
 
Natural User Interfaces
Natural User InterfacesNatural User Interfaces
Natural User InterfacesLuigi Oliveto
 

Ähnlich wie Using multitouch and sensors in Java (20)

Developing Rich Interfaces in JavaFX for Ultrabooks
Developing Rich Interfaces in JavaFX for UltrabooksDeveloping Rich Interfaces in JavaFX for Ultrabooks
Developing Rich Interfaces in JavaFX for Ultrabooks
 
Virtual Mouse
Virtual MouseVirtual Mouse
Virtual Mouse
 
Developing Rich Interfaces in JavaFX for Ultrabooks
Developing Rich Interfaces in JavaFX for UltrabooksDeveloping Rich Interfaces in JavaFX for Ultrabooks
Developing Rich Interfaces in JavaFX for Ultrabooks
 
JAVA PROGRAMMING- GUI Programming with Swing - The Swing Buttons
JAVA PROGRAMMING- GUI Programming with Swing - The Swing ButtonsJAVA PROGRAMMING- GUI Programming with Swing - The Swing Buttons
JAVA PROGRAMMING- GUI Programming with Swing - The Swing Buttons
 
Virtual Reality
Virtual RealityVirtual Reality
Virtual Reality
 
virtual reality Information-160422181930.pdf
virtual reality Information-160422181930.pdfvirtual reality Information-160422181930.pdf
virtual reality Information-160422181930.pdf
 
A computer vision based virtual mouse
A computer vision based virtual mouseA computer vision based virtual mouse
A computer vision based virtual mouse
 
Sixth sense technology ppt
Sixth sense technology pptSixth sense technology ppt
Sixth sense technology ppt
 
Sixth sense techno_ppt
Sixth sense techno_pptSixth sense techno_ppt
Sixth sense techno_ppt
 
Postmortem of a uwp xaml application development
Postmortem of a uwp xaml application developmentPostmortem of a uwp xaml application development
Postmortem of a uwp xaml application development
 
Everything About Android - Itvedant, Thane | Mumbai | Navi Mumbai
Everything About Android - Itvedant, Thane | Mumbai | Navi Mumbai Everything About Android - Itvedant, Thane | Mumbai | Navi Mumbai
Everything About Android - Itvedant, Thane | Mumbai | Navi Mumbai
 
Touchless Touchscreen
Touchless TouchscreenTouchless Touchscreen
Touchless Touchscreen
 
Sixth sense technology ppt
Sixth sense technology pptSixth sense technology ppt
Sixth sense technology ppt
 
Touchless touchscreen technology
Touchless touchscreen technologyTouchless touchscreen technology
Touchless touchscreen technology
 
Touchless touchscreen technology
Touchless touchscreen technologyTouchless touchscreen technology
Touchless touchscreen technology
 
Mobile AR Lecture 10 - Research Directions
Mobile AR Lecture 10 - Research DirectionsMobile AR Lecture 10 - Research Directions
Mobile AR Lecture 10 - Research Directions
 
Touchless Touchscreen Technology
Touchless Touchscreen TechnologyTouchless Touchscreen Technology
Touchless Touchscreen Technology
 
realtimeobject (2).pptx
realtimeobject (2).pptxrealtimeobject (2).pptx
realtimeobject (2).pptx
 
Android Programming Basic
Android Programming BasicAndroid Programming Basic
Android Programming Basic
 
Natural User Interfaces
Natural User InterfacesNatural User Interfaces
Natural User Interfaces
 

Mehr von Intel Software Brasil

Modernização de código em Xeon® e Xeon Phi™
Modernização de código em Xeon® e Xeon Phi™  Modernização de código em Xeon® e Xeon Phi™
Modernização de código em Xeon® e Xeon Phi™ Intel Software Brasil
 
Escreva sua App sem gastar energia, agora no KitKat
Escreva sua App sem gastar energia, agora no KitKatEscreva sua App sem gastar energia, agora no KitKat
Escreva sua App sem gastar energia, agora no KitKatIntel Software Brasil
 
Desafios do Desenvolvimento Multiplataforma
Desafios do Desenvolvimento MultiplataformaDesafios do Desenvolvimento Multiplataforma
Desafios do Desenvolvimento MultiplataformaIntel Software Brasil
 
Desafios do Desenvolvimento Multi-plataforma
Desafios do Desenvolvimento Multi-plataformaDesafios do Desenvolvimento Multi-plataforma
Desafios do Desenvolvimento Multi-plataformaIntel Software Brasil
 
Getting the maximum performance in distributed clusters Intel Cluster Studio XE
Getting the maximum performance in distributed clusters Intel Cluster Studio XEGetting the maximum performance in distributed clusters Intel Cluster Studio XE
Getting the maximum performance in distributed clusters Intel Cluster Studio XEIntel Software Brasil
 
Methods and practices to analyze the performance of your application with Int...
Methods and practices to analyze the performance of your application with Int...Methods and practices to analyze the performance of your application with Int...
Methods and practices to analyze the performance of your application with Int...Intel Software Brasil
 
Principais conceitos técnicas e modelos de programação paralela
Principais conceitos técnicas e modelos de programação paralelaPrincipais conceitos técnicas e modelos de programação paralela
Principais conceitos técnicas e modelos de programação paralelaIntel Software Brasil
 
Principais conceitos e técnicas em vetorização
Principais conceitos e técnicas em vetorizaçãoPrincipais conceitos e técnicas em vetorização
Principais conceitos e técnicas em vetorizaçãoIntel Software Brasil
 
Intel Technologies for High Performance Computing
Intel Technologies for High Performance ComputingIntel Technologies for High Performance Computing
Intel Technologies for High Performance ComputingIntel Software Brasil
 
Benchmarking para sistemas de alto desempenho
Benchmarking para sistemas de alto desempenhoBenchmarking para sistemas de alto desempenho
Benchmarking para sistemas de alto desempenhoIntel Software Brasil
 
Yocto no 1 IoT Day da Telefonica/Vivo
Yocto no 1 IoT Day da Telefonica/VivoYocto no 1 IoT Day da Telefonica/Vivo
Yocto no 1 IoT Day da Telefonica/VivoIntel Software Brasil
 
Otávio Salvador - Yocto project reduzindo -time to market- do seu próximo pr...
Otávio Salvador - Yocto project  reduzindo -time to market- do seu próximo pr...Otávio Salvador - Yocto project  reduzindo -time to market- do seu próximo pr...
Otávio Salvador - Yocto project reduzindo -time to market- do seu próximo pr...Intel Software Brasil
 
Desenvolvimento e análise de performance de jogos Android com Coco2d-HTML5
Desenvolvimento e análise de performance de jogos Android com Coco2d-HTML5Desenvolvimento e análise de performance de jogos Android com Coco2d-HTML5
Desenvolvimento e análise de performance de jogos Android com Coco2d-HTML5Intel Software Brasil
 

Mehr von Intel Software Brasil (20)

Modernização de código em Xeon® e Xeon Phi™
Modernização de código em Xeon® e Xeon Phi™  Modernização de código em Xeon® e Xeon Phi™
Modernização de código em Xeon® e Xeon Phi™
 
Escreva sua App sem gastar energia, agora no KitKat
Escreva sua App sem gastar energia, agora no KitKatEscreva sua App sem gastar energia, agora no KitKat
Escreva sua App sem gastar energia, agora no KitKat
 
Desafios do Desenvolvimento Multiplataforma
Desafios do Desenvolvimento MultiplataformaDesafios do Desenvolvimento Multiplataforma
Desafios do Desenvolvimento Multiplataforma
 
Desafios do Desenvolvimento Multi-plataforma
Desafios do Desenvolvimento Multi-plataformaDesafios do Desenvolvimento Multi-plataforma
Desafios do Desenvolvimento Multi-plataforma
 
Yocto - 7 masters
Yocto - 7 mastersYocto - 7 masters
Yocto - 7 masters
 
Getting the maximum performance in distributed clusters Intel Cluster Studio XE
Getting the maximum performance in distributed clusters Intel Cluster Studio XEGetting the maximum performance in distributed clusters Intel Cluster Studio XE
Getting the maximum performance in distributed clusters Intel Cluster Studio XE
 
Intel tools to optimize HPC systems
Intel tools to optimize HPC systemsIntel tools to optimize HPC systems
Intel tools to optimize HPC systems
 
Methods and practices to analyze the performance of your application with Int...
Methods and practices to analyze the performance of your application with Int...Methods and practices to analyze the performance of your application with Int...
Methods and practices to analyze the performance of your application with Int...
 
Principais conceitos técnicas e modelos de programação paralela
Principais conceitos técnicas e modelos de programação paralelaPrincipais conceitos técnicas e modelos de programação paralela
Principais conceitos técnicas e modelos de programação paralela
 
Principais conceitos e técnicas em vetorização
Principais conceitos e técnicas em vetorizaçãoPrincipais conceitos e técnicas em vetorização
Principais conceitos e técnicas em vetorização
 
Notes on NUMA architecture
Notes on NUMA architectureNotes on NUMA architecture
Notes on NUMA architecture
 
Intel Technologies for High Performance Computing
Intel Technologies for High Performance ComputingIntel Technologies for High Performance Computing
Intel Technologies for High Performance Computing
 
Benchmarking para sistemas de alto desempenho
Benchmarking para sistemas de alto desempenhoBenchmarking para sistemas de alto desempenho
Benchmarking para sistemas de alto desempenho
 
Yocto no 1 IoT Day da Telefonica/Vivo
Yocto no 1 IoT Day da Telefonica/VivoYocto no 1 IoT Day da Telefonica/Vivo
Yocto no 1 IoT Day da Telefonica/Vivo
 
Html5 fisl15
Html5 fisl15Html5 fisl15
Html5 fisl15
 
IoT FISL15
IoT FISL15IoT FISL15
IoT FISL15
 
IoT TDC Floripa 2014
IoT TDC Floripa 2014IoT TDC Floripa 2014
IoT TDC Floripa 2014
 
Otávio Salvador - Yocto project reduzindo -time to market- do seu próximo pr...
Otávio Salvador - Yocto project  reduzindo -time to market- do seu próximo pr...Otávio Salvador - Yocto project  reduzindo -time to market- do seu próximo pr...
Otávio Salvador - Yocto project reduzindo -time to market- do seu próximo pr...
 
Html5 tdc floripa_2014
Html5 tdc floripa_2014Html5 tdc floripa_2014
Html5 tdc floripa_2014
 
Desenvolvimento e análise de performance de jogos Android com Coco2d-HTML5
Desenvolvimento e análise de performance de jogos Android com Coco2d-HTML5Desenvolvimento e análise de performance de jogos Android com Coco2d-HTML5
Desenvolvimento e análise de performance de jogos Android com Coco2d-HTML5
 

Kürzlich hochgeladen

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
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)wesley chun
 
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...Neo4j
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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 AutomationSafe Software
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
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 organizationRadu Cotescu
 
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 BusinessPixlogix Infotech
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
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)
 
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...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

Using multitouch and sensors in Java

  • 1. Using multi-touch and sensors in Java Felipe Pedroso
  • 2. Agenda • The future of PCs • JavaFX and Touch Support • Using JNI to work with sensors 2
  • 3. Mobile Computing Lines are Blurring Smartphone Consumption Usages Tablet Ultrabook™ Convertible & Detachable Ultrabook™ Creation/Productivity Notebook
  • 4. Reshaping the PC Experience Multi-Touch Accelerometer Ambient Light Sensor Ultrabook™ Compass GPS Gyroscope Near Field Communication Context Aware Sensors 4
  • 5. OK, they have all those features… … but how can we implement them using Java?
  • 6. To allow users to TOUCH my Java App... • Should I use... • AWT? • Swing? • SWT? • Actually, you can use them but... • They aren’t made for multi-touch (OK, there’s a way to do it) • You must optimize your UI controls to be more ‘touch friendly’ • So, how to do it in a simple and easy way? 6
  • 7. 7
  • 8. Actions supported • Touch events: Down, Move and Up • Tap (Down and Up) / Double tap • Drag and Drop (Down, Move and Up) • Hold • Gestures • Swipe: Up, Down, Left and Right • Zoom: Pinch / Spread • Rotate 8
  • 9. What I need to do to manipulate components? • Your components must extend the Node class or any of its subclasses (StackPane, ImageView, etc) • Set the proper EventHandler to handle the action. 9
  • 10. What I need to do to manipulate components? • Apply a transform to the component (Translation, Rotation and Scale): • Let’s dive into some code! 10
  • 11. What about the sensors? JNI, I choose you!
  • 12. Available sensors on Ultrabooks • Accelerometer • Proper acceleration in three axis (x, y, z) • Gyrometer • Device orientation • Magnetometer • Strenght and direction of magnetic fields • GPS (Global Positioning System) • Location and Time information • NFC • Near Field Communication • Ambient Light Sensor • Ambient Light Level 12
  • 13. API Windows – Sensor Fusion 13
  • 14. API Windows – Namespaces • Windows.Sensors.*  Common sensors • • • • • • • Accelerometer Gyrometer Inclinometer OrientationSensor SimpleOrientationSensor Compass LightSensor • Windows.Devices.Geolocation  GPS • Geolocator • Windows.Networking.Proximity  NFC • ProximityDevice 14
  • 15. Windows API – How to • Get the default object of your sensor using the GetDefault method • You can call the GetCurrentReading() to get the current value of the sensors or... • ... work with the ReadingChanged event • Set the attribute ReportInterval (please, respect the MinimumReportInterval to avoid problems) • Delegate a method to handle the event (something like setting a method as a listener) • Handle the event! • This procedure is valid only for sensors from Windows.Sensors namespace 15
  • 16. How can I access that? 16
  • 17. Using JNI to access the sensors from Windows.Sensors 1. [Java] Create a native method to register the object that will handle the events that come from the sensor 2. Generate the header file using javah 3. [C++] Create a DLL Project in Visual Studio with the DLLs and namespaces of the Windows 8 APIS 4. [C++] Use a variable to keep a reference to the object and the ID (GetMethodID) of the method that will handle the event 17
  • 18. Using JNI to access the sensors from Windows.Sensors 5. [C++] Initialize the sensor and delegate a C++ method to handle the event 6. [C++] Redirect the delegate method call to the Java method using the function CallVoidMethod with the following parameters: the Java Object, the method ID and it’s parameters 7. [Java] Handle the event!  A lot of text? Please, show me the code! 18
  • 19. What about Linux? • Touch works fine, but there aren’t clear APIs to read sensors. If you know how to do it, let’s work together! 19
  • 20. Wants to know more about Intel Software? http://software.intel.com/pt-br/ 20
  • 24. Take aways • The PC experience is being reshaped • JavaFX + Touch = AWESOME • Using JNI to access the sensors can be LEGENDARY!
  • 25. Any doubts? (if yes, the answer is 42)
  • 26. Thanks a lot! Felipe Pedroso facebook.com/felipe.a.pedroso @felipeapedroso