Developing Series 40 Java Apps for Multiple UI Patterns

M
Microsoft Mobile DeveloperMicrosoft Mobile Developer
Series 40 Developer Training
Developing Series 40 Java apps for
multiple UI patterns


Michael Samarin, Ph.D
Director,
Developer Training and Evangelism
Futurice Oy
@MichaelSamarin
› Series 40 Device Range
                                            › Full Touch UI Style Guides
 Agenda for today’s
 webinar                                    › Adapting Touch & Type apps
                                            › Demonstrations with
                                              NetBeans and Nokia SDKs

         Don’t forget to take a look at previously recorded webinars:

http://www.developer.nokia.com/Resources/Multimedia/Webinars.xhtml#Webinar
Series 40 Mobile Java Platforms




5th Ed., FP1   6th Ed., Lite   6th Ed.   6th Ed., FP1   DP 1.0   DP 1.1   Developer Platform 2.0
New devices in 2012
        Asha 302      Nokia 111   Asha 311
› Java Heap size (1 – 4 MB)
             › JAR file size ( 1 – 2 MB)
             › CPU speed
Challenges   › Screen Size 240x 320,
               320x240, 128x160, 240x400
             › Input Type: T9, Qwerty,
               Touch-And-Type, Full Touch
› LCDUI
               › Nokia Java Developer’s Library
Solutions   › LWUIT for Series 40
    (non
  games)       › http://projects.developer.nokia.com/LWUIT_for_Series_40

            › Tantalum 3
               › http://projects.developer.nokia.com/Tantalum
Devices are released and in consumer hands today:

                                     Asha
                                     305
                                     306
                                     311
› Codebase on Full Touch is
                                          backward compatible

  Existing Touch &                      › Older Midlets “just work”
Type or Non Touch                       › Of course UI requires
              apps                        tweaking and remodeling to
                                          utilize new UI paradigm


Best help in understanding new UI - Series 40 Full Touch Design Guidelines:

http://www.developer.nokia.com/Resources/Library/Full_Touch/#!index.html
› Single build for multiple
   Strategies for     target devices
       targeting       › Code level configurations
Touch & Type and    › Multiple builds for multiple
       Full Touch     target devices
                       › IDE level configurations
» For single build targeting multiple devices checkout porting part of webinar:
» Andreas Jakl, Nokia
    › Introduction to Nokia Series 40 Full Touch UI

    › http://www.slideshare.net/nokia-developer/introduction-to-series-40-full-touch-ui

    › http://forumnokia.adobeconnect.com/p3yw0g4jz6f/

» Following slides are extracts
Compatibility?
» Source & binary compatible
   –   xx years old Java ME apps run on
       full touch phones!

» Downwards compatibility

   –   Check API support of target phones

   –   Lowest common denominator:

         → Nokia Java SDK 2.0 compiled app
         runs on old phones
Porting to Touch
»   All Java ME apps should run on full touch phone
     –   High-Level UI
           –   Adapts automatically

           –   Components include touch-support

           –   Check layout

           –   New UI components (CategoryBar, etc.) don’t have to be used

     –   Low-Level UI
           –   New screen size & aspect ratio (but: most Java apps already flexible here)

           –   Touch supported in Java ME since many years

           –   Basic key simulation with drag gestures for non-touch apps

»   New APIs for Multipoint touch, Pinch, CategoryBar & Sensors
     –   Only work on FT phones
     –   Careful app design even keeps downwards compatibility
Dynamic API Usage
» Single code base for different phones

   – Code that uses new APIs

       – Externalize to extra class

   – Check API support at runtime

       – Instantiate class if supported

       – Different methods for checking available
Porting




                                            Touch and type
Non-touch app with high-level UI (LCDUI):
Automatically adapts to touch
         Non-touch




                                            Full touch
Example: Pinch Gesture
» Gesture API
      – Available in Touch & Type

      – Full Touch adds Pinch gesture

      – Query support at runtime
      // Pinch gesture
      if (GestureInteractiveZone.isSupported(GestureInteractiveZone.GESTURE_PINCH)) {
          // Gesture is supported - register class as listener
          GestureRegistrationManager.setListener(this, this);
          // Register for pinch gesture
          gestureZone = new GestureInteractiveZone(GestureInteractiveZone.GESTURE_PINCH);
          GestureRegistrationManager.register(this, gestureZone);
      }




 15      © 2012 Nokia Java ME Touch v1.3.0 June 27, 2012 Andreas Jakl
Example: Optional Multitouch
»       Encapsulate API using code to separate class
    public class MultitouchManager implements MultipointTouchListener {

         public MultitouchManager(MainCanvas canvas) {                                     Hint: only handle
             MultipointTouch mpt = MultipointTouch.getInstance();                          Canvas.pointerPressed()
             mpt.addMultipointTouchListener(this);                                         on single touch phones
         }

         public void pointersChanged(int[] pointerIds) { /* ... */ }   protected void pointerPressed(int x, int y) {
    }                                                                      if (!useMultitouch) {
                                                                               // Handle touch event
                                                                               // on single-touch phone
» Check support and instantiate on demand                                  }
                                                                       }
    if (System.getProperty("com.nokia.mid.ui.multipointtouch.version") != null) {
        // API is supported: Can implement multipoint touch functionality
        multiManager = new MultitouchManager(this);
                                                                                           In MainCanvas class
        useMultitouch = true;
                                                                                           (extends Canvas)
    }
Example: API Availability
» No System property for the API version?

   – Check Class availability

   – ClassNotFoundException? → API not supported

    // Virtual keyboard support
    try {
        // Check if class is available
        Class.forName("com.nokia.mid.ui.VirtualKeyboard");
        vkbManager = new VkbManager(this);
        useVkb = true;
    } catch (ClassNotFoundException e) {
        // Class not available: running app on Java Runtime < 2.0.0 phone.
        // -> no Virtual Keyboard API support.
        useVkb = false;
    } catch (Exception e) { }
» For multiple builds targeting multiple devices currently NetBeans provides
  simplest and hassle free solution.
» Use NetBeans “Configurations” when targeting multiple devices / SDKs, for
  example Nokia SDK for Java 1.1 (Touch & Type) and Nokia SDK for Java 2.0 (Full
  Touch).
» Live Demo
» If you are watching this slides on SlideShare, next part is live coding
  demonstration.You can see video recording from the link in the comments
  section. Link should appear within week after live webinar.
› Topics related to today’s webinar:
› Porting from BlackBerry to Series 40 Wiki article:
› http://www.developer.nokia.com/Community/Wiki/Porting_from
  _BlackBerry_to_Series_40
› Porting from Android to Series 40 Guide:
› http://www.developer.nokia.com/Resources/Library/Porting_to_
  Series_40/#!porting-from-android-to-series-40.html
› Java for Mobile Devices:
  New Horizons with Fantastic
  New Devices
   › Monday, Oct 1, 8:30AM
   › Notel Nikko – Monterey I/II
Thank you!




  @MichaelSamarin
http://www.futurice.com
1 of 21

Recommended

Adapting Series 40 touch and type apps to the full-touch UI by
Adapting Series 40 touch and type apps to the full-touch UIAdapting Series 40 touch and type apps to the full-touch UI
Adapting Series 40 touch and type apps to the full-touch UIMicrosoft Mobile Developer
903 views17 slides
2. the aegis story building an accessible application by
2. the aegis story   building an accessible application2. the aegis story   building an accessible application
2. the aegis story building an accessible applicationAEGIS-ACCESSIBLE Projects
304 views14 slides
Qt App Development for Symbian & MeeGo - v3.4.6 (17. January 2012) by
Qt App Development for Symbian & MeeGo - v3.4.6 (17. January 2012)Qt App Development for Symbian & MeeGo - v3.4.6 (17. January 2012)
Qt App Development for Symbian & MeeGo - v3.4.6 (17. January 2012)Andreas Jakl
5.8K views53 slides
Android terminologies by
Android terminologiesAndroid terminologies
Android terminologiesjerry vasoya
3.1K views56 slides
Android App Development Intro at ESC SV 2012 by
Android App Development Intro at ESC SV 2012Android App Development Intro at ESC SV 2012
Android App Development Intro at ESC SV 2012Opersys inc.
4.9K views59 slides
Android Overview by
Android OverviewAndroid Overview
Android OverviewJussi Pohjolainen
676 views37 slides

More Related Content

What's hot

Android Crash Course Lunch and Learn by
Android Crash Course Lunch and LearnAndroid Crash Course Lunch and Learn
Android Crash Course Lunch and LearnPaul Irwin
281 views62 slides
2012 java one-con3648 by
2012 java one-con36482012 java one-con3648
2012 java one-con3648Eing Ong
787 views27 slides
Intel AppUp Webinar Italiano General Information by
Intel AppUp Webinar Italiano General InformationIntel AppUp Webinar Italiano General Information
Intel AppUp Webinar Italiano General InformationIntel Developer Zone Community
678 views18 slides
Meego Italian Day 2011 – Andrea Grandi by
Meego Italian Day 2011 – Andrea GrandiMeego Italian Day 2011 – Andrea Grandi
Meego Italian Day 2011 – Andrea GrandiFrancesco Baldassarri
1.1K views54 slides
eSWT: The new UI toolkit for the mobile java by
eSWT: The new UI toolkit for the mobile javaeSWT: The new UI toolkit for the mobile java
eSWT: The new UI toolkit for the mobile javaGorkem Ercan
644 views10 slides
Android complete basic Guide by
Android complete basic GuideAndroid complete basic Guide
Android complete basic GuideAKASH SINGH
3.1K views152 slides

What's hot(13)

Android Crash Course Lunch and Learn by Paul Irwin
Android Crash Course Lunch and LearnAndroid Crash Course Lunch and Learn
Android Crash Course Lunch and Learn
Paul Irwin281 views
2012 java one-con3648 by Eing Ong
2012 java one-con36482012 java one-con3648
2012 java one-con3648
Eing Ong787 views
eSWT: The new UI toolkit for the mobile java by Gorkem Ercan
eSWT: The new UI toolkit for the mobile javaeSWT: The new UI toolkit for the mobile java
eSWT: The new UI toolkit for the mobile java
Gorkem Ercan644 views
Android complete basic Guide by AKASH SINGH
Android complete basic GuideAndroid complete basic Guide
Android complete basic Guide
AKASH SINGH3.1K views
What's new in Android Pie by Hassan Abid
What's new in Android PieWhat's new in Android Pie
What's new in Android Pie
Hassan Abid1K views
Dori waldman android _course_2 by Dori Waldman
Dori waldman android _course_2Dori waldman android _course_2
Dori waldman android _course_2
Dori Waldman4K views
Html5 investigation by oppokui
Html5 investigationHtml5 investigation
Html5 investigation
oppokui2.6K views
iOS 7 Accessibility by Ted Drake
iOS 7 AccessibilityiOS 7 Accessibility
iOS 7 Accessibility
Ted Drake6.1K views
Android Programming Basic by Duy Do Phan
Android Programming BasicAndroid Programming Basic
Android Programming Basic
Duy Do Phan1.9K views

Similar to Developing Series 40 Java Apps for Multiple UI Patterns

600.250 UI Cross Platform Development and the Android Security Model by
600.250 UI Cross Platform Development and the Android Security Model600.250 UI Cross Platform Development and the Android Security Model
600.250 UI Cross Platform Development and the Android Security ModelMichael Rushanan
855 views25 slides
Introduction to MonoTouch by
Introduction to MonoTouchIntroduction to MonoTouch
Introduction to MonoTouchJonas Follesø
1.2K views42 slides
Getting Started with XCTest and XCUITest for iOS App Testing by
Getting Started with XCTest and XCUITest for iOS App TestingGetting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App TestingBitbar
13K views30 slides
SWE-401 - 8. Software User Interface Design by
SWE-401 - 8. Software User Interface DesignSWE-401 - 8. Software User Interface Design
SWE-401 - 8. Software User Interface Designghayour abbas
89 views9 slides
Flutter technology Based on Web Development by
Flutter technology Based on Web Development Flutter technology Based on Web Development
Flutter technology Based on Web Development divyawani2
130 views35 slides
Java Is A Programming Dialect And Registering Stage Essay by
Java Is A Programming Dialect And Registering Stage EssayJava Is A Programming Dialect And Registering Stage Essay
Java Is A Programming Dialect And Registering Stage EssayLiz Sims
3 views81 slides

Similar to Developing Series 40 Java Apps for Multiple UI Patterns(20)

600.250 UI Cross Platform Development and the Android Security Model by Michael Rushanan
600.250 UI Cross Platform Development and the Android Security Model600.250 UI Cross Platform Development and the Android Security Model
600.250 UI Cross Platform Development and the Android Security Model
Michael Rushanan855 views
Introduction to MonoTouch by Jonas Follesø
Introduction to MonoTouchIntroduction to MonoTouch
Introduction to MonoTouch
Jonas Follesø1.2K views
Getting Started with XCTest and XCUITest for iOS App Testing by Bitbar
Getting Started with XCTest and XCUITest for iOS App TestingGetting Started with XCTest and XCUITest for iOS App Testing
Getting Started with XCTest and XCUITest for iOS App Testing
Bitbar13K views
SWE-401 - 8. Software User Interface Design by ghayour abbas
SWE-401 - 8. Software User Interface DesignSWE-401 - 8. Software User Interface Design
SWE-401 - 8. Software User Interface Design
ghayour abbas89 views
Flutter technology Based on Web Development by divyawani2
Flutter technology Based on Web Development Flutter technology Based on Web Development
Flutter technology Based on Web Development
divyawani2130 views
Java Is A Programming Dialect And Registering Stage Essay by Liz Sims
Java Is A Programming Dialect And Registering Stage EssayJava Is A Programming Dialect And Registering Stage Essay
Java Is A Programming Dialect And Registering Stage Essay
Liz Sims3 views
Symbian OS by Adit Pathak
Symbian  OS Symbian  OS
Symbian OS
Adit Pathak1.3K views
Panther Sniffer for DQMH®.pptx by EnriqueNo2
Panther Sniffer for DQMH®.pptxPanther Sniffer for DQMH®.pptx
Panther Sniffer for DQMH®.pptx
EnriqueNo219 views
Windows 8 Platform & Store by Ed Donahue
Windows 8 Platform & StoreWindows 8 Platform & Store
Windows 8 Platform & Store
Ed Donahue513 views
Build 2017 - P4115 - Windows High DPI Improvements for Desktop by Windows Developer
Build 2017 - P4115 - Windows High DPI Improvements for DesktopBuild 2017 - P4115 - Windows High DPI Improvements for Desktop
Build 2017 - P4115 - Windows High DPI Improvements for Desktop
Windows Developer189 views
Build 2017 - P4115 - Go big! Optimizing your applications for large screen ex... by Windows Developer
Build 2017 - P4115 - Go big! Optimizing your applications for large screen ex...Build 2017 - P4115 - Go big! Optimizing your applications for large screen ex...
Build 2017 - P4115 - Go big! Optimizing your applications for large screen ex...
Windows Developer133 views
Matteo Valoriani, Antimo Musone - The Future of Factory - Codemotion Rome 2019 by Codemotion
Matteo Valoriani, Antimo Musone - The Future of Factory - Codemotion Rome 2019Matteo Valoriani, Antimo Musone - The Future of Factory - Codemotion Rome 2019
Matteo Valoriani, Antimo Musone - The Future of Factory - Codemotion Rome 2019
Codemotion397 views
EasyJPJ : Mobile Application Slide by RazinRashid1
EasyJPJ : Mobile Application SlideEasyJPJ : Mobile Application Slide
EasyJPJ : Mobile Application Slide
RazinRashid191 views
.NET Innovations and Improvements by Jeff Chu
.NET Innovations and Improvements.NET Innovations and Improvements
.NET Innovations and Improvements
Jeff Chu530 views
Cross platform development with c# and xamarin by Luca Zulian
Cross platform development with c# and xamarinCross platform development with c# and xamarin
Cross platform development with c# and xamarin
Luca Zulian1.3K views
Selenium in the palm of your hand: Appium and automated mobile testing by Isaac Murchie
Selenium in the palm of your hand: Appium and automated mobile testingSelenium in the palm of your hand: Appium and automated mobile testing
Selenium in the palm of your hand: Appium and automated mobile testing
Isaac Murchie795 views
09 gui 13 by Niit Care
09 gui 1309 gui 13
09 gui 13
Niit Care361 views
Meego의 현재와 미래(2) by mosaicnet
Meego의 현재와 미래(2)Meego의 현재와 미래(2)
Meego의 현재와 미래(2)
mosaicnet1.3K views
2012 star west-t10 by Eing Ong
2012 star west-t102012 star west-t10
2012 star west-t10
Eing Ong971 views

More from Microsoft Mobile Developer

Intro to Nokia X software platform 2.0 and tools by
Intro to Nokia X software platform 2.0 and toolsIntro to Nokia X software platform 2.0 and tools
Intro to Nokia X software platform 2.0 and toolsMicrosoft Mobile Developer
7.5K views34 slides
Lumia App Labs: Lumia SensorCore SDK beta by
Lumia App Labs: Lumia SensorCore SDK betaLumia App Labs: Lumia SensorCore SDK beta
Lumia App Labs: Lumia SensorCore SDK betaMicrosoft Mobile Developer
10.1K views40 slides
Nokia Asha from idea to app - Imaging by
Nokia Asha from idea to app - ImagingNokia Asha from idea to app - Imaging
Nokia Asha from idea to app - ImagingMicrosoft Mobile Developer
8.6K views18 slides
Healthcare apps for Nokia X and Nokia Asha by
Healthcare apps for Nokia X and Nokia AshaHealthcare apps for Nokia X and Nokia Asha
Healthcare apps for Nokia X and Nokia AshaMicrosoft Mobile Developer
9.4K views16 slides
Push notifications on Nokia X by
Push notifications on Nokia XPush notifications on Nokia X
Push notifications on Nokia XMicrosoft Mobile Developer
16K views14 slides
DIY Nokia Asha app usability studies by
DIY Nokia Asha app usability studiesDIY Nokia Asha app usability studies
DIY Nokia Asha app usability studiesMicrosoft Mobile Developer
7.4K views42 slides

More from Microsoft Mobile Developer(20)

Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations by Microsoft Mobile Developer
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultationsLumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations

Recently uploaded

Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...ShapeBlue
198 views20 slides
Future of AR - Facebook Presentation by
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook PresentationRob McCarty
64 views27 slides
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITShapeBlue
206 views8 slides
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates by
Keynote Talk: Open Source is Not Dead - Charles Schulz - VatesKeynote Talk: Open Source is Not Dead - Charles Schulz - Vates
Keynote Talk: Open Source is Not Dead - Charles Schulz - VatesShapeBlue
252 views15 slides
Digital Personal Data Protection (DPDP) Practical Approach For CISOs by
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOsPriyanka Aash
158 views59 slides
DRBD Deep Dive - Philipp Reisner - LINBIT by
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBITShapeBlue
180 views21 slides

Recently uploaded(20)

Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue198 views
Future of AR - Facebook Presentation by Rob McCarty
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
Rob McCarty64 views
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue206 views
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates by ShapeBlue
Keynote Talk: Open Source is Not Dead - Charles Schulz - VatesKeynote Talk: Open Source is Not Dead - Charles Schulz - Vates
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates
ShapeBlue252 views
Digital Personal Data Protection (DPDP) Practical Approach For CISOs by Priyanka Aash
Digital Personal Data Protection (DPDP) Practical Approach For CISOsDigital Personal Data Protection (DPDP) Practical Approach For CISOs
Digital Personal Data Protection (DPDP) Practical Approach For CISOs
Priyanka Aash158 views
DRBD Deep Dive - Philipp Reisner - LINBIT by ShapeBlue
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBIT
ShapeBlue180 views
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava... by ShapeBlue
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
Centralized Logging Feature in CloudStack using ELK and Grafana - Kiran Chava...
ShapeBlue145 views
Business Analyst Series 2023 - Week 4 Session 8 by DianaGray10
Business Analyst Series 2023 -  Week 4 Session 8Business Analyst Series 2023 -  Week 4 Session 8
Business Analyst Series 2023 - Week 4 Session 8
DianaGray10123 views
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue147 views
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by ShapeBlue
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
ShapeBlue161 views
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker54 views
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
ShapeBlue263 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays56 views
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti... by ShapeBlue
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
ShapeBlue139 views
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P... by ShapeBlue
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
ShapeBlue194 views
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ... by ShapeBlue
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
ShapeBlue186 views
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue by ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlueMigrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
ShapeBlue218 views

Developing Series 40 Java Apps for Multiple UI Patterns

  • 1. Series 40 Developer Training Developing Series 40 Java apps for multiple UI patterns Michael Samarin, Ph.D Director, Developer Training and Evangelism Futurice Oy @MichaelSamarin
  • 2. › Series 40 Device Range › Full Touch UI Style Guides Agenda for today’s webinar › Adapting Touch & Type apps › Demonstrations with NetBeans and Nokia SDKs Don’t forget to take a look at previously recorded webinars: http://www.developer.nokia.com/Resources/Multimedia/Webinars.xhtml#Webinar
  • 3. Series 40 Mobile Java Platforms 5th Ed., FP1 6th Ed., Lite 6th Ed. 6th Ed., FP1 DP 1.0 DP 1.1 Developer Platform 2.0
  • 4. New devices in 2012 Asha 302 Nokia 111 Asha 311
  • 5. › Java Heap size (1 – 4 MB) › JAR file size ( 1 – 2 MB) › CPU speed Challenges › Screen Size 240x 320, 320x240, 128x160, 240x400 › Input Type: T9, Qwerty, Touch-And-Type, Full Touch
  • 6. › LCDUI › Nokia Java Developer’s Library Solutions › LWUIT for Series 40 (non games) › http://projects.developer.nokia.com/LWUIT_for_Series_40 › Tantalum 3 › http://projects.developer.nokia.com/Tantalum
  • 7. Devices are released and in consumer hands today: Asha 305 306 311
  • 8. › Codebase on Full Touch is backward compatible Existing Touch & › Older Midlets “just work” Type or Non Touch › Of course UI requires apps tweaking and remodeling to utilize new UI paradigm Best help in understanding new UI - Series 40 Full Touch Design Guidelines: http://www.developer.nokia.com/Resources/Library/Full_Touch/#!index.html
  • 9. › Single build for multiple Strategies for target devices targeting › Code level configurations Touch & Type and › Multiple builds for multiple Full Touch target devices › IDE level configurations
  • 10. » For single build targeting multiple devices checkout porting part of webinar: » Andreas Jakl, Nokia › Introduction to Nokia Series 40 Full Touch UI › http://www.slideshare.net/nokia-developer/introduction-to-series-40-full-touch-ui › http://forumnokia.adobeconnect.com/p3yw0g4jz6f/ » Following slides are extracts
  • 11. Compatibility? » Source & binary compatible – xx years old Java ME apps run on full touch phones! » Downwards compatibility – Check API support of target phones – Lowest common denominator: → Nokia Java SDK 2.0 compiled app runs on old phones
  • 12. Porting to Touch » All Java ME apps should run on full touch phone – High-Level UI – Adapts automatically – Components include touch-support – Check layout – New UI components (CategoryBar, etc.) don’t have to be used – Low-Level UI – New screen size & aspect ratio (but: most Java apps already flexible here) – Touch supported in Java ME since many years – Basic key simulation with drag gestures for non-touch apps » New APIs for Multipoint touch, Pinch, CategoryBar & Sensors – Only work on FT phones – Careful app design even keeps downwards compatibility
  • 13. Dynamic API Usage » Single code base for different phones – Code that uses new APIs – Externalize to extra class – Check API support at runtime – Instantiate class if supported – Different methods for checking available
  • 14. Porting Touch and type Non-touch app with high-level UI (LCDUI): Automatically adapts to touch Non-touch Full touch
  • 15. Example: Pinch Gesture » Gesture API – Available in Touch & Type – Full Touch adds Pinch gesture – Query support at runtime // Pinch gesture if (GestureInteractiveZone.isSupported(GestureInteractiveZone.GESTURE_PINCH)) { // Gesture is supported - register class as listener GestureRegistrationManager.setListener(this, this); // Register for pinch gesture gestureZone = new GestureInteractiveZone(GestureInteractiveZone.GESTURE_PINCH); GestureRegistrationManager.register(this, gestureZone); } 15 © 2012 Nokia Java ME Touch v1.3.0 June 27, 2012 Andreas Jakl
  • 16. Example: Optional Multitouch » Encapsulate API using code to separate class public class MultitouchManager implements MultipointTouchListener { public MultitouchManager(MainCanvas canvas) { Hint: only handle MultipointTouch mpt = MultipointTouch.getInstance(); Canvas.pointerPressed() mpt.addMultipointTouchListener(this); on single touch phones } public void pointersChanged(int[] pointerIds) { /* ... */ } protected void pointerPressed(int x, int y) { } if (!useMultitouch) { // Handle touch event // on single-touch phone » Check support and instantiate on demand } } if (System.getProperty("com.nokia.mid.ui.multipointtouch.version") != null) { // API is supported: Can implement multipoint touch functionality multiManager = new MultitouchManager(this); In MainCanvas class useMultitouch = true; (extends Canvas) }
  • 17. Example: API Availability » No System property for the API version? – Check Class availability – ClassNotFoundException? → API not supported // Virtual keyboard support try { // Check if class is available Class.forName("com.nokia.mid.ui.VirtualKeyboard"); vkbManager = new VkbManager(this); useVkb = true; } catch (ClassNotFoundException e) { // Class not available: running app on Java Runtime < 2.0.0 phone. // -> no Virtual Keyboard API support. useVkb = false; } catch (Exception e) { }
  • 18. » For multiple builds targeting multiple devices currently NetBeans provides simplest and hassle free solution. » Use NetBeans “Configurations” when targeting multiple devices / SDKs, for example Nokia SDK for Java 1.1 (Touch & Type) and Nokia SDK for Java 2.0 (Full Touch). » Live Demo » If you are watching this slides on SlideShare, next part is live coding demonstration.You can see video recording from the link in the comments section. Link should appear within week after live webinar.
  • 19. › Topics related to today’s webinar: › Porting from BlackBerry to Series 40 Wiki article: › http://www.developer.nokia.com/Community/Wiki/Porting_from _BlackBerry_to_Series_40 › Porting from Android to Series 40 Guide: › http://www.developer.nokia.com/Resources/Library/Porting_to_ Series_40/#!porting-from-android-to-series-40.html
  • 20. › Java for Mobile Devices: New Horizons with Fantastic New Devices › Monday, Oct 1, 8:30AM › Notel Nikko – Monterey I/II
  • 21. Thank you! @MichaelSamarin http://www.futurice.com