SlideShare a Scribd company logo
1 of 21
Download to read offline
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

More Related Content

What's hot

2012 java one-con3648
2012 java one-con36482012 java one-con3648
2012 java one-con3648
Eing Ong
 
Android Programming Basic
Android Programming BasicAndroid Programming Basic
Android Programming Basic
Duy Do Phan
 

What's hot (13)

Android Crash Course Lunch and Learn
Android Crash Course Lunch and LearnAndroid Crash Course Lunch and Learn
Android Crash Course Lunch and Learn
 
2012 java one-con3648
2012 java one-con36482012 java one-con3648
2012 java one-con3648
 
Intel AppUp Webinar Italiano General Information
Intel AppUp Webinar Italiano General InformationIntel AppUp Webinar Italiano General Information
Intel AppUp Webinar Italiano General Information
 
Meego Italian Day 2011 – Andrea Grandi
Meego Italian Day 2011 – Andrea GrandiMeego Italian Day 2011 – Andrea Grandi
Meego Italian Day 2011 – Andrea Grandi
 
eSWT: The new UI toolkit for the mobile java
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
 
Android complete basic Guide
Android complete basic GuideAndroid complete basic Guide
Android complete basic Guide
 
Android Programming
Android ProgrammingAndroid Programming
Android Programming
 
What's new in Android Pie
What's new in Android PieWhat's new in Android Pie
What's new in Android Pie
 
Dori waldman android _course_2
Dori waldman android _course_2Dori waldman android _course_2
Dori waldman android _course_2
 
Html5 investigation
Html5 investigationHtml5 investigation
Html5 investigation
 
iOS 7 Accessibility
iOS 7 AccessibilityiOS 7 Accessibility
iOS 7 Accessibility
 
Android Programming Basic
Android Programming BasicAndroid Programming Basic
Android Programming Basic
 
Android tutorial1
Android tutorial1Android tutorial1
Android tutorial1
 

Similar to Developing Series 40 Java Apps for Multiple UI Patterns

Introduction to MonoTouch
Introduction to MonoTouchIntroduction to MonoTouch
Introduction to MonoTouch
Jonas Follesø
 
Java Is A Programming Dialect And Registering Stage Essay
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 Sims
 

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

600.250 UI Cross Platform Development and the Android Security Model
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
 
Introduction to MonoTouch
Introduction to MonoTouchIntroduction to MonoTouch
Introduction to MonoTouch
 
Getting Started with XCTest and XCUITest for iOS App Testing
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
 
SWE-401 - 8. Software User Interface Design
SWE-401 - 8. Software User Interface DesignSWE-401 - 8. Software User Interface Design
SWE-401 - 8. Software User Interface Design
 
Flutter technology Based on Web Development
Flutter technology Based on Web Development Flutter technology Based on Web Development
Flutter technology Based on Web Development
 
Java Is A Programming Dialect And Registering Stage Essay
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
 
Symbian OS
Symbian  OS Symbian  OS
Symbian OS
 
Panther Sniffer for DQMH®.pptx
Panther Sniffer for DQMH®.pptxPanther Sniffer for DQMH®.pptx
Panther Sniffer for DQMH®.pptx
 
Windows 8 Platform & Store
Windows 8 Platform & StoreWindows 8 Platform & Store
Windows 8 Platform & Store
 
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...
Build 2017 - P4115 - Go big! Optimizing your applications for large screen ex...
 
Build 2017 - P4115 - Windows High DPI Improvements for Desktop
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
 
Matteo Valoriani, Antimo Musone - The Future of Factory - Codemotion Rome 2019
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
 
EasyJPJ : Mobile Application Slide
EasyJPJ : Mobile Application SlideEasyJPJ : Mobile Application Slide
EasyJPJ : Mobile Application Slide
 
Android Development recipes with java.pptx
Android Development recipes with java.pptxAndroid Development recipes with java.pptx
Android Development recipes with java.pptx
 
.NET Innovations and Improvements
.NET Innovations and Improvements.NET Innovations and Improvements
.NET Innovations and Improvements
 
Cross platform development with c# and xamarin
Cross platform development with c# and xamarinCross platform development with c# and xamarin
Cross platform development with c# and xamarin
 
Selenium in the palm of your hand: Appium and automated mobile testing
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
 
09 gui 13
09 gui 1309 gui 13
09 gui 13
 
Porting Android apps to the Series 40 platform
Porting Android apps to the Series 40 platformPorting Android apps to the Series 40 platform
Porting Android apps to the Series 40 platform
 
Meego의 현재와 미래(2)
Meego의 현재와 미래(2)Meego의 현재와 미래(2)
Meego의 현재와 미래(2)
 

More from Microsoft Mobile Developer

More from Microsoft Mobile Developer (20)

Intro to Nokia X software platform 2.0 and tools
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 tools
 
Lumia App Labs: Lumia SensorCore SDK beta
Lumia App Labs: Lumia SensorCore SDK betaLumia App Labs: Lumia SensorCore SDK beta
Lumia App Labs: Lumia SensorCore SDK beta
 
Nokia Asha from idea to app - Imaging
Nokia Asha from idea to app - ImagingNokia Asha from idea to app - Imaging
Nokia Asha from idea to app - Imaging
 
Healthcare apps for Nokia X and Nokia Asha
Healthcare apps for Nokia X and Nokia AshaHealthcare apps for Nokia X and Nokia Asha
Healthcare apps for Nokia X and Nokia Asha
 
Push notifications on Nokia X
Push notifications on Nokia XPush notifications on Nokia X
Push notifications on Nokia X
 
DIY Nokia Asha app usability studies
DIY Nokia Asha app usability studiesDIY Nokia Asha app usability studies
DIY Nokia Asha app usability studies
 
Lessons learned from Nokia X UI reviews
Lessons learned from Nokia X UI reviewsLessons learned from Nokia X UI reviews
Lessons learned from Nokia X UI reviews
 
Location based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tagLocation based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tag
 
HERE Maps for the Nokia X platform
HERE Maps for the Nokia X platformHERE Maps for the Nokia X platform
HERE Maps for the Nokia X platform
 
Nokia In-App Payment - UX considerations
Nokia In-App Payment - UX considerationsNokia In-App Payment - UX considerations
Nokia In-App Payment - UX considerations
 
Introduction to Nokia Asha SDK 1.2 (beta)
Introduction to Nokia Asha SDK 1.2 (beta)Introduction to Nokia Asha SDK 1.2 (beta)
Introduction to Nokia Asha SDK 1.2 (beta)
 
UX considerations when porting to Nokia X
UX considerations when porting to Nokia XUX considerations when porting to Nokia X
UX considerations when porting to Nokia X
 
Kids' games and educational app design
Kids' games and educational app designKids' games and educational app design
Kids' games and educational app design
 
Nokia X: opportunities for developers
Nokia X: opportunities for developersNokia X: opportunities for developers
Nokia X: opportunities for developers
 
Lumia App Labs: Nokia Imaging SDK 1.1
Lumia App Labs: Nokia Imaging SDK 1.1Lumia App Labs: Nokia Imaging SDK 1.1
Lumia App Labs: Nokia Imaging SDK 1.1
 
Intro to Nokia X software platform and tools
Intro to Nokia X software platform and toolsIntro to Nokia X software platform and tools
Intro to Nokia X software platform and tools
 
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations
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
 
Windows Phone 8 speech: parliamo con la nostra app
Windows Phone 8 speech: parliamo con la nostra appWindows Phone 8 speech: parliamo con la nostra app
Windows Phone 8 speech: parliamo con la nostra app
 
La pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo storeLa pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo store
 
Il pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progettoIl pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progetto
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

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