Developing Series 40 Java Apps for Multiple UI Patterns

Uploaded on

From this presentation, you’ll learn key development techniques for projects targeting Series 40 phones with multiple UI patterns: Touch and Type, non-touch, and full touch. You’ll learn how to …

From this presentation, you’ll learn key development techniques for projects targeting Series 40 phones with multiple UI patterns: Touch and Type, non-touch, and full touch. You’ll learn how to architect your Java™ ME applications and use the right tools to adapt to variations in screen dimensions, input methods, new APIs, and memory constraints. We’ll use the NetBeans IDE, the Nokia IDE for Java™ ME (Eclipse-based), and various Nokia SDKs for the Series 40 platform.

More in: Technology , Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • Excelente...!
    Are you sure you want to
    Your message goes here
  • And here is the recording for session 2:
    Are you sure you want to
    Your message goes here
  • Recording of session 1 is live now:
    Are you sure you want to
    Your message goes here
No Downloads


Total Views
On Slideshare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. Series 40 Developer TrainingDeveloping Series 40 Java apps formultiple UI patternsMichael Samarin, Ph.DDirector,Developer Training and EvangelismFuturice 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:
  • 3. Series 40 Mobile Java Platforms5th 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 speedChallenges › Screen Size 240x 320, 320x240, 128x160, 240x400 › Input Type: T9, Qwerty, Touch-And-Type, Full Touch
  • 6. › LCDUI › Nokia Java Developer’s LibrarySolutions › LWUIT for Series 40 (non games) › › Tantalum 3 ›
  • 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 paradigmBest help in understanding new UI - Series 40 Full Touch Design Guidelines:!index.html
  • 9. › Single build for multiple Strategies for target devices targeting › Code level configurationsTouch & 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 › ›» 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 typeNon-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("") != 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(""); 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:› _BlackBerry_to_Series_40› Porting from Android to Series 40 Guide:› 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