SlideShare a Scribd company logo
1 of 33
Java™Platform, Micro Edition Part 2 – High Level UI v3.0 – 01 April 2009 1 Andreas Jakl, 2009
Disclaimer These slides are provided free of charge at http://www.symbianresources.com and are used during Java ME courses at the University of Applied Sciences in Hagenberg, Austria at the Mobile Computing department ( http://www.fh-ooe.at/mc ) Respecting the copyright laws, you are allowed to use them: for your own, personal, non-commercial use in the academic environment In all other cases (e.g. for commercial training), please contact andreas.jakl@fh-hagenberg.at The correctness of the contents of these materials cannot be guaranteed. Andreas Jakl is not liable for incorrect information or damage that may arise from using the materials. This document contains copyright materials which are proprietary to Sun or various mobile device manufacturers, including Nokia, SonyEricsson and Motorola. Sun, Sun Microsystems, the Sun Logo and the Java™ Platform, Micro Edition are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.  Andreas Jakl, 2009 2
GUI Elements High-Level GUI Andreas Jakl, 2009 3
Hierarchy of Displayables Andreas Jakl, 2009 Display One Display instance / MIDlet Available in all sub-classes of Displayable Command Displayable Methods for drawing to a canvas Low Level UIDraw the GUI yourself, own event handling. Used for games andbigger commercial applications. High Level UIAppearance based on default phone UI design, can not be influenced. Canvas Screen Ticker Graphics Completely pre-defined screen layouts TextBox Form List Alert Arrange predefined controls on a screen. Item Spacer CustomItem Choice (Interface) ChoiceGroup StringItem DateField ImageItem TextField Gauge 4
Hierarchy of Displayables Andreas Jakl, 2009 Display One Display instance / MIDlet Available in all sub-classes of Displayable Command Displayable Methods for drawing to a canvas Canvas Screen Ticker Graphics TextBox Form List Alert Item Spacer CustomItem Choice (Interface) ChoiceGroup StringItem DateField ImageItem TextField Gauge 5
Forms and Items How to create your own layouts Andreas Jakl, 2009 6
Form “Container” for items Displays multiple items below each other on the screen Automatic scrolling Andreas Jakl, 2009 7
Form and Items WTK emulator 2.5 (DefaultColorPhone) Nokia 7710 Emulator Andreas Jakl, 2009 Individual items, automatically arranged below each other. The appearance depends on the phone. 8
Example: ChoiceGroup Selection from multiple elements Either exclusive or multi-selection Type: EXCLUSIVE Type: MULTIPLE Type: POPUP 9 Andreas Jakl, 2009
Process Create the Form Form frmMain = new Form ("Title"); Create the ChoiceGroup ChoiceGroupitmCG = new ChoiceGroup ("Your choice:", ChoiceGroup.EXCLUSIVE);itmCG.append ("Rock", null);itmCG.append ("Paper", null); Add the ChoiceGroup to the Form frmMain.append (itmCG); If necessary: to instantly get information about item changes, register the class as ItemStateListener frmMain.setItemStateListener (this); Andreas Jakl, 2009 Usually created as member variable for easier access later on. 10
itemStateChanged() Will be called by the framework when the item selection changes: public void itemStateChanged (Item item){    if (item == itmCG)    {        if (itmCG.getSelectedIndex() == 1) { … }    }} MIDP doesn’t require that this has to be called for every single change.  Andreas Jakl, 2009 11
Item: StringItem For (modifiable) display of text Contains label (usually highlighted) and message Not editable by the user Create it explicitly: StringItemitmSI = new StringItem("StringItem",                                   "with Text");frmMain.append(itmSI); Implicit creation: // Not possible to set label frmMain.append("with Text"); … but more work when you want to change the text later on Andreas Jakl, 2009 12
Item: TextField Single- or multiline text input Optional filters to restrict the input: Andreas Jakl, 2009 13
Item: Gauge Interactive: Allow the user to modify the value (e.g. volume) Non-interactive: Progress bar (e.g. download) Infinitely running activity bar (unknown duration, e.g. when establishing a connection to a server) Andreas Jakl, 2009 14
Item: DateField To modify a Java Dateobject (date + time) Implementation of the date/time-editor highly dependent on device manufacturer e.g. date entry: graphical calendar view in Sun WTK or just plain text entry on many devices Andreas Jakl, 2009 15
Item: ImageItem Display a .png image Can also be used as button or hyperlink Various methods for positioning Code: Image im = Image.createImage("/img.png");frmMain.append(new ImageItem("ImageItem", im, ImageItem.LAYOUT_DEFAULT, null)); Graphics can also be used for ChoiceGroups, Alerts, and Lists Andreas Jakl, 2009 16
Other Items Spacer Separate two items by a specified distance Works vertically and horizontally CustomItem Base class to develop your own UI items These have to be implemented in a low-level way (you draw the item content directly using lines, …) Disadvantage: No automated adaption to the colours / layout of the system (= used by standard items) in MIDP 2.0 Andreas Jakl, 2009 17
Commands for Items Set Commands specifically for items Analogous to all objects derived from Displayable: item.addCommand(myCmd); Handling through ItemCommandListenerInterface Andreas Jakl, 2009 18
Screens Predefined standard components Andreas Jakl, 2009 19
Alert Simple dialog box Managed completely by the device, e.g. no own Commands are possible 4 visual attributes can be specified: Title Image (optional) Progress bar (optional) Text (optional) Two Alert types: Modal: Has to be dismissed by the useral.setTimeout(Alert.FOREVER); Timed: Displayed for x millisecondsal.setTimeout(1000); Andreas Jakl, 2009 20
Alert – Display Display-sequence when using an alert: Screen  Alert is being displayed  previous Screendisplay.setCurrent(al); Screen  Alertis being displayed  new Screendisplay.setCurrent(al, nextScreen); Andreas Jakl, 2009 Recap:Screen = Form, Alert, List, TextBox, Canvas 21
Alert – with Sound! Predefined sounds: Display an alert with a sound:Alert al = new Alert("Alert", "Message", null, AlertType.WARNING); Or play the sounds without displaying the Alert dialog:AlertType.INFO.playSound(display); Andreas Jakl, 2009 22
List Similar to a (full-screen) ChoiceGroupitem: select items from a list that you define Available in addition to EXCLUSIVE and MULTIPLE: IMPLICIT-Lists: selection triggers an action that can be defined by you. list = new List("Animals", List.IMPLICIT);list.append("Dogs", null);list.append("Cats", null);list.append("Snakes", null);list.setSelectCommand (cmdSelect);list.addCommand (cmdInfo);list.setCommandListener (this); Andreas Jakl, 2009 23 German for “select”
TextBox Fullscreentextinput Mostlybehaveslike a TextField-Item txtBox = new TextBox("Credit Card Number", null, 16, TextField.NUMERIC|TextField.SENSITIVE|TextField.NON_PREDICTIVE); Andreas Jakl, 2009 Default text Max. length Title Restrictions Modifiers 24
Ticker Text as ticker for instances of Displayable-objects Can not be influenced, usage usually not recommended Ticker t = new Ticker ("Vienna 30°, Barcelona 37°, Hawaii 42°");txtBox.setTicker (t);[…]// Modify the textt.setString(„Munich 17°, …");[…]// Remove the tickertxtBox.setTicker (null); Andreas Jakl, 2009 25
New UI Toolkits Now & the Future Andreas Jakl, 2009 26
eSWT Embedded Standard Widget Toolkit Cross platform toolkit Part of Eclipse eRCP (embedded Rich Client Platform) Shares most APIs with desktop SWT Features (excerpt): Rich UI Component set Flexible and scalable layout system via layout managers Rich user interface events Access to native UI functionality on par with smartphone UI frameworks Andreas Jakl, 2009 27
eSWT Integrates operating system Most “real” work done by optimized, platform-specific code (no drawing directly through Java) Traditional Java GUI library characteristics UI is constructed by widgets in containers Containers use layout managers to scale the UI Available since: S60 3rd Ed., FP2 Andreas Jakl, 2009 28
LWUIT LightWeight User Interface Toolkit Inspired by Swing But designed for constrained devices Can be added to any Java ME application (embedded .jar) Drawing done in Java source code, without native peer rendering Features (excerpt): Layouts Themes, fonts Animations & Transitions 3D / SVG integration (optional) Internationalization Andreas Jakl, 2009 29
JavaFX JavaFX(http://javafx.com – integrated in NetBeans 6.5+) New UI libraries (graphics, media, web services) Consistent experience across mobile, desktop, browser, TV, etc Plus: use any Java library in JavaFX Integrated with Java Runtime JavaFX Script Simple declarative language, easier to learn e.g., for artists to change sprite animation, without needing software developer Advantage to JavaScript / ActionScript: integration with Java – reuse any Java library Andreas Jakl, 2009 30
JavaFX Mobile Runs on Java ME (plus Android) Mobile content with same tools as Java FX Availability? JavaFX Mobile Runtime needs to be pre-installed on the phone. None released yet. Currently endorsed by: SonyEricsson, LG Andreas Jakl, 2009 31
eSWT vs. LWUIT vs. JavaFX Mobile? Architecture LWUIT & eSWT: scene graph component model framework (like Swing / SWT) JavaFX: more a vector graphics platform Features LWUIT: Simulates UI design in pure Java-code, doesn’t fit to phone UI. OK for games, not for business. eSWT: Uses native code for drawing. More flexible (browser component, etc.). Good for business and speed, not so useful for games. Support LWUIT: can be used today eSWT: only on latest Nokia phones JavaFX: Not supported yet by phones. Fully vector graphics based – will only work on newest phones Conclusion Depending on use case: Use eSWT / LWUIT now. JavaFX Mobile will be the future. http://weblogs.java.net/blog/terrencebarr/archive/2008/08/comparing_lwuit.html Andreas Jakl, 2009 32
Thanks for your attention That’s it! Andreas Jakl, 2009 33

More Related Content

Viewers also liked

Java ME - 01 - Overview
Java ME - 01 - OverviewJava ME - 01 - Overview
Java ME - 01 - OverviewAndreas Jakl
 
Javascript Basics
Javascript BasicsJavascript Basics
Javascript Basicsmsemenistyi
 
11 Java User Interface Libraries for Developing Mobile Applications
11 Java User Interface Libraries for Developing Mobile Applications11 Java User Interface Libraries for Developing Mobile Applications
11 Java User Interface Libraries for Developing Mobile ApplicationsAEGIS-ACCESSIBLE Projects
 
Java in the Air: A Case Study for Java-based Environment Monitoring Stations
Java in the Air: A Case Study for Java-based Environment Monitoring StationsJava in the Air: A Case Study for Java-based Environment Monitoring Stations
Java in the Air: A Case Study for Java-based Environment Monitoring StationsEurotech
 
Statistical Process Control Tools
Statistical Process Control ToolsStatistical Process Control Tools
Statistical Process Control ToolsRaja Farhan Saeed
 
AggreGate SCADA/HMI
AggreGate SCADA/HMI AggreGate SCADA/HMI
AggreGate SCADA/HMI Tibbo
 
8 introduction to_java_script
8 introduction to_java_script8 introduction to_java_script
8 introduction to_java_scriptVijay Kalyan
 

Viewers also liked (9)

Java ME - 01 - Overview
Java ME - 01 - OverviewJava ME - 01 - Overview
Java ME - 01 - Overview
 
Javascript Basics
Javascript BasicsJavascript Basics
Javascript Basics
 
11 Java User Interface Libraries for Developing Mobile Applications
11 Java User Interface Libraries for Developing Mobile Applications11 Java User Interface Libraries for Developing Mobile Applications
11 Java User Interface Libraries for Developing Mobile Applications
 
J2ME GUI Programming
J2ME GUI ProgrammingJ2ME GUI Programming
J2ME GUI Programming
 
Java in the Air: A Case Study for Java-based Environment Monitoring Stations
Java in the Air: A Case Study for Java-based Environment Monitoring StationsJava in the Air: A Case Study for Java-based Environment Monitoring Stations
Java in the Air: A Case Study for Java-based Environment Monitoring Stations
 
Statistical Process Control Tools
Statistical Process Control ToolsStatistical Process Control Tools
Statistical Process Control Tools
 
AggreGate SCADA/HMI
AggreGate SCADA/HMI AggreGate SCADA/HMI
AggreGate SCADA/HMI
 
8 introduction to_java_script
8 introduction to_java_script8 introduction to_java_script
8 introduction to_java_script
 
Java script
Java scriptJava script
Java script
 

Similar to Java ME - 02 - High Level UI

Symbian OS - Quick Start
Symbian OS - Quick StartSymbian OS - Quick Start
Symbian OS - Quick StartAndreas Jakl
 
Symbian OS - GUI Architectures
Symbian OS - GUI ArchitecturesSymbian OS - GUI Architectures
Symbian OS - GUI ArchitecturesAndreas Jakl
 
Mobile Operating Systems
Mobile Operating SystemsMobile Operating Systems
Mobile Operating SystemsAndreas Jakl
 
Symbian OS - Platform Security
Symbian OS - Platform SecuritySymbian OS - Platform Security
Symbian OS - Platform SecurityAndreas Jakl
 
Om Pawar MP AJP.docx
Om Pawar MP AJP.docxOm Pawar MP AJP.docx
Om Pawar MP AJP.docxOmpawar61
 
Symbian OS - Memory Management
Symbian OS - Memory ManagementSymbian OS - Memory Management
Symbian OS - Memory ManagementAndreas Jakl
 
Symbian OS - Mopoid Next Gen - Slides
Symbian OS - Mopoid Next Gen - SlidesSymbian OS - Mopoid Next Gen - Slides
Symbian OS - Mopoid Next Gen - SlidesAndreas Jakl
 
GrafiXML, A Multi-Target User Interface Builder based on UsiXML
GrafiXML, A Multi-Target User Interface Builder based on UsiXMLGrafiXML, A Multi-Target User Interface Builder based on UsiXML
GrafiXML, A Multi-Target User Interface Builder based on UsiXMLJean Vanderdonckt
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspectiveGunjan Kumar
 
Introductontoxaml
IntroductontoxamlIntroductontoxaml
Introductontoxamlsunhope777
 
Going Mobile with AIR+Starling
Going Mobile with AIR+StarlingGoing Mobile with AIR+Starling
Going Mobile with AIR+StarlingAmos Laber
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming BasicsEueung Mulyana
 
Advance Java Programming (CM5I) 1.AWT
Advance Java Programming (CM5I) 1.AWTAdvance Java Programming (CM5I) 1.AWT
Advance Java Programming (CM5I) 1.AWTPayal Dungarwal
 
I phone app develoment ppt
I phone app develoment   pptI phone app develoment   ppt
I phone app develoment pptsagaroceanic11
 
I phone app develoment ppt
I phone app develoment   pptI phone app develoment   ppt
I phone app develoment pptsagaroceanic11
 
Actionscript 3 - Session 3 Action Script And Flash
Actionscript 3 - Session 3 Action Script And FlashActionscript 3 - Session 3 Action Script And Flash
Actionscript 3 - Session 3 Action Script And FlashOUM SAOKOSAL
 

Similar to Java ME - 02 - High Level UI (20)

Symbian OS - Quick Start
Symbian OS - Quick StartSymbian OS - Quick Start
Symbian OS - Quick Start
 
Symbian OS - GUI Architectures
Symbian OS - GUI ArchitecturesSymbian OS - GUI Architectures
Symbian OS - GUI Architectures
 
Mobile Operating Systems
Mobile Operating SystemsMobile Operating Systems
Mobile Operating Systems
 
Symbian OS - Platform Security
Symbian OS - Platform SecuritySymbian OS - Platform Security
Symbian OS - Platform Security
 
Windows 7 mobile
Windows 7 mobileWindows 7 mobile
Windows 7 mobile
 
Symbian OS - S60
Symbian OS - S60Symbian OS - S60
Symbian OS - S60
 
Om Pawar MP AJP.docx
Om Pawar MP AJP.docxOm Pawar MP AJP.docx
Om Pawar MP AJP.docx
 
Symbian OS - Memory Management
Symbian OS - Memory ManagementSymbian OS - Memory Management
Symbian OS - Memory Management
 
Apple TV - a quick start guide
Apple TV - a quick start guideApple TV - a quick start guide
Apple TV - a quick start guide
 
Symbian OS - Mopoid Next Gen - Slides
Symbian OS - Mopoid Next Gen - SlidesSymbian OS - Mopoid Next Gen - Slides
Symbian OS - Mopoid Next Gen - Slides
 
GrafiXML, A Multi-Target User Interface Builder based on UsiXML
GrafiXML, A Multi-Target User Interface Builder based on UsiXMLGrafiXML, A Multi-Target User Interface Builder based on UsiXML
GrafiXML, A Multi-Target User Interface Builder based on UsiXML
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
 
Introductontoxaml
IntroductontoxamlIntroductontoxaml
Introductontoxaml
 
Going Mobile with AIR+Starling
Going Mobile with AIR+StarlingGoing Mobile with AIR+Starling
Going Mobile with AIR+Starling
 
Mac Os X Version 10
Mac Os X Version 10Mac Os X Version 10
Mac Os X Version 10
 
Android Programming Basics
Android Programming BasicsAndroid Programming Basics
Android Programming Basics
 
Advance Java Programming (CM5I) 1.AWT
Advance Java Programming (CM5I) 1.AWTAdvance Java Programming (CM5I) 1.AWT
Advance Java Programming (CM5I) 1.AWT
 
I phone app develoment ppt
I phone app develoment   pptI phone app develoment   ppt
I phone app develoment ppt
 
I phone app develoment ppt
I phone app develoment   pptI phone app develoment   ppt
I phone app develoment ppt
 
Actionscript 3 - Session 3 Action Script And Flash
Actionscript 3 - Session 3 Action Script And FlashActionscript 3 - Session 3 Action Script And Flash
Actionscript 3 - Session 3 Action Script And Flash
 

More from Andreas Jakl

Create Engaging Healthcare Experiences with Augmented Reality
Create Engaging Healthcare Experiences with Augmented RealityCreate Engaging Healthcare Experiences with Augmented Reality
Create Engaging Healthcare Experiences with Augmented RealityAndreas Jakl
 
AR / VR Interaction Development with Unity
AR / VR Interaction Development with UnityAR / VR Interaction Development with Unity
AR / VR Interaction Development with UnityAndreas Jakl
 
Android Development with Kotlin, Part 3 - Code and App Management
Android Development with Kotlin, Part 3 - Code and App ManagementAndroid Development with Kotlin, Part 3 - Code and App Management
Android Development with Kotlin, Part 3 - Code and App ManagementAndreas Jakl
 
Android Development with Kotlin, Part 2 - Internet Services and JSON
Android Development with Kotlin, Part 2 - Internet Services and JSONAndroid Development with Kotlin, Part 2 - Internet Services and JSON
Android Development with Kotlin, Part 2 - Internet Services and JSONAndreas Jakl
 
Android Development with Kotlin, Part 1 - Introduction
Android Development with Kotlin, Part 1 - IntroductionAndroid Development with Kotlin, Part 1 - Introduction
Android Development with Kotlin, Part 1 - IntroductionAndreas Jakl
 
Android and NFC / NDEF (with Kotlin)
Android and NFC / NDEF (with Kotlin)Android and NFC / NDEF (with Kotlin)
Android and NFC / NDEF (with Kotlin)Andreas Jakl
 
Basics of Web Technologies
Basics of Web TechnologiesBasics of Web Technologies
Basics of Web TechnologiesAndreas Jakl
 
Bluetooth Beacons - Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 & More
Bluetooth Beacons - Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 & MoreBluetooth Beacons - Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 & More
Bluetooth Beacons - Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 & MoreAndreas Jakl
 
Which new scenarios are enabled by Windows 10 for NFC, Bluetooth LE & Beacons?
Which new scenarios are enabled by Windows 10 for NFC, Bluetooth LE & Beacons?Which new scenarios are enabled by Windows 10 for NFC, Bluetooth LE & Beacons?
Which new scenarios are enabled by Windows 10 for NFC, Bluetooth LE & Beacons?Andreas Jakl
 
Mobile Test Automation
Mobile Test AutomationMobile Test Automation
Mobile Test AutomationAndreas Jakl
 
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...Andreas Jakl
 
WinJS, Apache Cordova & NFC - HTML5 apps for Android and Windows Phone
WinJS, Apache Cordova & NFC - HTML5 apps for Android and Windows PhoneWinJS, Apache Cordova & NFC - HTML5 apps for Android and Windows Phone
WinJS, Apache Cordova & NFC - HTML5 apps for Android and Windows PhoneAndreas Jakl
 
Nokia New Asha Platform Developer Training
Nokia New Asha Platform Developer TrainingNokia New Asha Platform Developer Training
Nokia New Asha Platform Developer TrainingAndreas Jakl
 
Windows Phone 8 NFC Quickstart
Windows Phone 8 NFC QuickstartWindows Phone 8 NFC Quickstart
Windows Phone 8 NFC QuickstartAndreas Jakl
 
Windows (Phone) 8 NFC App Scenarios
Windows (Phone) 8 NFC App ScenariosWindows (Phone) 8 NFC App Scenarios
Windows (Phone) 8 NFC App ScenariosAndreas Jakl
 
Windows 8 Platform NFC Development
Windows 8 Platform NFC DevelopmentWindows 8 Platform NFC Development
Windows 8 Platform NFC DevelopmentAndreas Jakl
 
NFC Development with Qt - v2.2.0 (5. November 2012)
NFC Development with Qt - v2.2.0 (5. November 2012)NFC Development with Qt - v2.2.0 (5. November 2012)
NFC Development with Qt - v2.2.0 (5. November 2012)Andreas Jakl
 
06 - Qt Communication
06 - Qt Communication06 - Qt Communication
06 - Qt CommunicationAndreas Jakl
 
05 - Qt External Interaction and Graphics
05 - Qt External Interaction and Graphics05 - Qt External Interaction and Graphics
05 - Qt External Interaction and GraphicsAndreas Jakl
 

More from Andreas Jakl (20)

Create Engaging Healthcare Experiences with Augmented Reality
Create Engaging Healthcare Experiences with Augmented RealityCreate Engaging Healthcare Experiences with Augmented Reality
Create Engaging Healthcare Experiences with Augmented Reality
 
AR / VR Interaction Development with Unity
AR / VR Interaction Development with UnityAR / VR Interaction Development with Unity
AR / VR Interaction Development with Unity
 
Android Development with Kotlin, Part 3 - Code and App Management
Android Development with Kotlin, Part 3 - Code and App ManagementAndroid Development with Kotlin, Part 3 - Code and App Management
Android Development with Kotlin, Part 3 - Code and App Management
 
Android Development with Kotlin, Part 2 - Internet Services and JSON
Android Development with Kotlin, Part 2 - Internet Services and JSONAndroid Development with Kotlin, Part 2 - Internet Services and JSON
Android Development with Kotlin, Part 2 - Internet Services and JSON
 
Android Development with Kotlin, Part 1 - Introduction
Android Development with Kotlin, Part 1 - IntroductionAndroid Development with Kotlin, Part 1 - Introduction
Android Development with Kotlin, Part 1 - Introduction
 
Android and NFC / NDEF (with Kotlin)
Android and NFC / NDEF (with Kotlin)Android and NFC / NDEF (with Kotlin)
Android and NFC / NDEF (with Kotlin)
 
Basics of Web Technologies
Basics of Web TechnologiesBasics of Web Technologies
Basics of Web Technologies
 
Bluetooth Beacons - Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 & More
Bluetooth Beacons - Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 & MoreBluetooth Beacons - Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 & More
Bluetooth Beacons - Bluetooth 5, iBeacon, Eddystone, Arduino, Windows 10 & More
 
Which new scenarios are enabled by Windows 10 for NFC, Bluetooth LE & Beacons?
Which new scenarios are enabled by Windows 10 for NFC, Bluetooth LE & Beacons?Which new scenarios are enabled by Windows 10 for NFC, Bluetooth LE & Beacons?
Which new scenarios are enabled by Windows 10 for NFC, Bluetooth LE & Beacons?
 
Mobile Test Automation
Mobile Test AutomationMobile Test Automation
Mobile Test Automation
 
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
 
WinJS, Apache Cordova & NFC - HTML5 apps for Android and Windows Phone
WinJS, Apache Cordova & NFC - HTML5 apps for Android and Windows PhoneWinJS, Apache Cordova & NFC - HTML5 apps for Android and Windows Phone
WinJS, Apache Cordova & NFC - HTML5 apps for Android and Windows Phone
 
Nokia New Asha Platform Developer Training
Nokia New Asha Platform Developer TrainingNokia New Asha Platform Developer Training
Nokia New Asha Platform Developer Training
 
Windows Phone 8 NFC Quickstart
Windows Phone 8 NFC QuickstartWindows Phone 8 NFC Quickstart
Windows Phone 8 NFC Quickstart
 
Windows (Phone) 8 NFC App Scenarios
Windows (Phone) 8 NFC App ScenariosWindows (Phone) 8 NFC App Scenarios
Windows (Phone) 8 NFC App Scenarios
 
Windows 8 Platform NFC Development
Windows 8 Platform NFC DevelopmentWindows 8 Platform NFC Development
Windows 8 Platform NFC Development
 
NFC Development with Qt - v2.2.0 (5. November 2012)
NFC Development with Qt - v2.2.0 (5. November 2012)NFC Development with Qt - v2.2.0 (5. November 2012)
NFC Development with Qt - v2.2.0 (5. November 2012)
 
06 - Qt Communication
06 - Qt Communication06 - Qt Communication
06 - Qt Communication
 
05 - Qt External Interaction and Graphics
05 - Qt External Interaction and Graphics05 - Qt External Interaction and Graphics
05 - Qt External Interaction and Graphics
 
04 - Qt Data
04 - Qt Data04 - Qt Data
04 - Qt Data
 

Recently uploaded

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 

Recently uploaded (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 

Java ME - 02 - High Level UI

  • 1. Java™Platform, Micro Edition Part 2 – High Level UI v3.0 – 01 April 2009 1 Andreas Jakl, 2009
  • 2. Disclaimer These slides are provided free of charge at http://www.symbianresources.com and are used during Java ME courses at the University of Applied Sciences in Hagenberg, Austria at the Mobile Computing department ( http://www.fh-ooe.at/mc ) Respecting the copyright laws, you are allowed to use them: for your own, personal, non-commercial use in the academic environment In all other cases (e.g. for commercial training), please contact andreas.jakl@fh-hagenberg.at The correctness of the contents of these materials cannot be guaranteed. Andreas Jakl is not liable for incorrect information or damage that may arise from using the materials. This document contains copyright materials which are proprietary to Sun or various mobile device manufacturers, including Nokia, SonyEricsson and Motorola. Sun, Sun Microsystems, the Sun Logo and the Java™ Platform, Micro Edition are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. Andreas Jakl, 2009 2
  • 3. GUI Elements High-Level GUI Andreas Jakl, 2009 3
  • 4. Hierarchy of Displayables Andreas Jakl, 2009 Display One Display instance / MIDlet Available in all sub-classes of Displayable Command Displayable Methods for drawing to a canvas Low Level UIDraw the GUI yourself, own event handling. Used for games andbigger commercial applications. High Level UIAppearance based on default phone UI design, can not be influenced. Canvas Screen Ticker Graphics Completely pre-defined screen layouts TextBox Form List Alert Arrange predefined controls on a screen. Item Spacer CustomItem Choice (Interface) ChoiceGroup StringItem DateField ImageItem TextField Gauge 4
  • 5. Hierarchy of Displayables Andreas Jakl, 2009 Display One Display instance / MIDlet Available in all sub-classes of Displayable Command Displayable Methods for drawing to a canvas Canvas Screen Ticker Graphics TextBox Form List Alert Item Spacer CustomItem Choice (Interface) ChoiceGroup StringItem DateField ImageItem TextField Gauge 5
  • 6. Forms and Items How to create your own layouts Andreas Jakl, 2009 6
  • 7. Form “Container” for items Displays multiple items below each other on the screen Automatic scrolling Andreas Jakl, 2009 7
  • 8. Form and Items WTK emulator 2.5 (DefaultColorPhone) Nokia 7710 Emulator Andreas Jakl, 2009 Individual items, automatically arranged below each other. The appearance depends on the phone. 8
  • 9. Example: ChoiceGroup Selection from multiple elements Either exclusive or multi-selection Type: EXCLUSIVE Type: MULTIPLE Type: POPUP 9 Andreas Jakl, 2009
  • 10. Process Create the Form Form frmMain = new Form ("Title"); Create the ChoiceGroup ChoiceGroupitmCG = new ChoiceGroup ("Your choice:", ChoiceGroup.EXCLUSIVE);itmCG.append ("Rock", null);itmCG.append ("Paper", null); Add the ChoiceGroup to the Form frmMain.append (itmCG); If necessary: to instantly get information about item changes, register the class as ItemStateListener frmMain.setItemStateListener (this); Andreas Jakl, 2009 Usually created as member variable for easier access later on. 10
  • 11. itemStateChanged() Will be called by the framework when the item selection changes: public void itemStateChanged (Item item){ if (item == itmCG) { if (itmCG.getSelectedIndex() == 1) { … } }} MIDP doesn’t require that this has to be called for every single change. Andreas Jakl, 2009 11
  • 12. Item: StringItem For (modifiable) display of text Contains label (usually highlighted) and message Not editable by the user Create it explicitly: StringItemitmSI = new StringItem("StringItem", "with Text");frmMain.append(itmSI); Implicit creation: // Not possible to set label frmMain.append("with Text"); … but more work when you want to change the text later on Andreas Jakl, 2009 12
  • 13. Item: TextField Single- or multiline text input Optional filters to restrict the input: Andreas Jakl, 2009 13
  • 14. Item: Gauge Interactive: Allow the user to modify the value (e.g. volume) Non-interactive: Progress bar (e.g. download) Infinitely running activity bar (unknown duration, e.g. when establishing a connection to a server) Andreas Jakl, 2009 14
  • 15. Item: DateField To modify a Java Dateobject (date + time) Implementation of the date/time-editor highly dependent on device manufacturer e.g. date entry: graphical calendar view in Sun WTK or just plain text entry on many devices Andreas Jakl, 2009 15
  • 16. Item: ImageItem Display a .png image Can also be used as button or hyperlink Various methods for positioning Code: Image im = Image.createImage("/img.png");frmMain.append(new ImageItem("ImageItem", im, ImageItem.LAYOUT_DEFAULT, null)); Graphics can also be used for ChoiceGroups, Alerts, and Lists Andreas Jakl, 2009 16
  • 17. Other Items Spacer Separate two items by a specified distance Works vertically and horizontally CustomItem Base class to develop your own UI items These have to be implemented in a low-level way (you draw the item content directly using lines, …) Disadvantage: No automated adaption to the colours / layout of the system (= used by standard items) in MIDP 2.0 Andreas Jakl, 2009 17
  • 18. Commands for Items Set Commands specifically for items Analogous to all objects derived from Displayable: item.addCommand(myCmd); Handling through ItemCommandListenerInterface Andreas Jakl, 2009 18
  • 19. Screens Predefined standard components Andreas Jakl, 2009 19
  • 20. Alert Simple dialog box Managed completely by the device, e.g. no own Commands are possible 4 visual attributes can be specified: Title Image (optional) Progress bar (optional) Text (optional) Two Alert types: Modal: Has to be dismissed by the useral.setTimeout(Alert.FOREVER); Timed: Displayed for x millisecondsal.setTimeout(1000); Andreas Jakl, 2009 20
  • 21. Alert – Display Display-sequence when using an alert: Screen  Alert is being displayed  previous Screendisplay.setCurrent(al); Screen  Alertis being displayed  new Screendisplay.setCurrent(al, nextScreen); Andreas Jakl, 2009 Recap:Screen = Form, Alert, List, TextBox, Canvas 21
  • 22. Alert – with Sound! Predefined sounds: Display an alert with a sound:Alert al = new Alert("Alert", "Message", null, AlertType.WARNING); Or play the sounds without displaying the Alert dialog:AlertType.INFO.playSound(display); Andreas Jakl, 2009 22
  • 23. List Similar to a (full-screen) ChoiceGroupitem: select items from a list that you define Available in addition to EXCLUSIVE and MULTIPLE: IMPLICIT-Lists: selection triggers an action that can be defined by you. list = new List("Animals", List.IMPLICIT);list.append("Dogs", null);list.append("Cats", null);list.append("Snakes", null);list.setSelectCommand (cmdSelect);list.addCommand (cmdInfo);list.setCommandListener (this); Andreas Jakl, 2009 23 German for “select”
  • 24. TextBox Fullscreentextinput Mostlybehaveslike a TextField-Item txtBox = new TextBox("Credit Card Number", null, 16, TextField.NUMERIC|TextField.SENSITIVE|TextField.NON_PREDICTIVE); Andreas Jakl, 2009 Default text Max. length Title Restrictions Modifiers 24
  • 25. Ticker Text as ticker for instances of Displayable-objects Can not be influenced, usage usually not recommended Ticker t = new Ticker ("Vienna 30°, Barcelona 37°, Hawaii 42°");txtBox.setTicker (t);[…]// Modify the textt.setString(„Munich 17°, …");[…]// Remove the tickertxtBox.setTicker (null); Andreas Jakl, 2009 25
  • 26. New UI Toolkits Now & the Future Andreas Jakl, 2009 26
  • 27. eSWT Embedded Standard Widget Toolkit Cross platform toolkit Part of Eclipse eRCP (embedded Rich Client Platform) Shares most APIs with desktop SWT Features (excerpt): Rich UI Component set Flexible and scalable layout system via layout managers Rich user interface events Access to native UI functionality on par with smartphone UI frameworks Andreas Jakl, 2009 27
  • 28. eSWT Integrates operating system Most “real” work done by optimized, platform-specific code (no drawing directly through Java) Traditional Java GUI library characteristics UI is constructed by widgets in containers Containers use layout managers to scale the UI Available since: S60 3rd Ed., FP2 Andreas Jakl, 2009 28
  • 29. LWUIT LightWeight User Interface Toolkit Inspired by Swing But designed for constrained devices Can be added to any Java ME application (embedded .jar) Drawing done in Java source code, without native peer rendering Features (excerpt): Layouts Themes, fonts Animations & Transitions 3D / SVG integration (optional) Internationalization Andreas Jakl, 2009 29
  • 30. JavaFX JavaFX(http://javafx.com – integrated in NetBeans 6.5+) New UI libraries (graphics, media, web services) Consistent experience across mobile, desktop, browser, TV, etc Plus: use any Java library in JavaFX Integrated with Java Runtime JavaFX Script Simple declarative language, easier to learn e.g., for artists to change sprite animation, without needing software developer Advantage to JavaScript / ActionScript: integration with Java – reuse any Java library Andreas Jakl, 2009 30
  • 31. JavaFX Mobile Runs on Java ME (plus Android) Mobile content with same tools as Java FX Availability? JavaFX Mobile Runtime needs to be pre-installed on the phone. None released yet. Currently endorsed by: SonyEricsson, LG Andreas Jakl, 2009 31
  • 32. eSWT vs. LWUIT vs. JavaFX Mobile? Architecture LWUIT & eSWT: scene graph component model framework (like Swing / SWT) JavaFX: more a vector graphics platform Features LWUIT: Simulates UI design in pure Java-code, doesn’t fit to phone UI. OK for games, not for business. eSWT: Uses native code for drawing. More flexible (browser component, etc.). Good for business and speed, not so useful for games. Support LWUIT: can be used today eSWT: only on latest Nokia phones JavaFX: Not supported yet by phones. Fully vector graphics based – will only work on newest phones Conclusion Depending on use case: Use eSWT / LWUIT now. JavaFX Mobile will be the future. http://weblogs.java.net/blog/terrencebarr/archive/2008/08/comparing_lwuit.html Andreas Jakl, 2009 32
  • 33. Thanks for your attention That’s it! Andreas Jakl, 2009 33