SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
Nokia Series 40

Optimizing Nokia Map
Applications for Series 40 Touch
Devices


Jason Fox
Technical Support Engineer
Maps Platform
1   © Nokia 2012 Creating Map Components for Touch.pptx
Agenda
1. Architectural Overview of the
   Nokia Maps API for Java ME.
2. An Introduction to Map Components
3. Reacting to Map Events
4. Creating Touchable Map Components
5. Adding Buttons to a Map Canvas
6. Adding Gesture Controls
7. Retrofitting Touch Controls to your App
      Note: A complete set of video demos is available at:
      http://www.youtube.com/watch?v=P3qfd7_OrpY



2   © Nokia 2012 Creating Map Components for Touch.pptx
Architectural Overview of the
Nokia Maps API for Java ME



3   © Nokia 2012 Creating Map Components for Touch.pptx
What is Nokia Maps API for Java ME?
An extendable API aimed at Series 40 Phones,
targeting all devices supporting MIDP 2.0 or higher.
Allows you to develop mobile applications based on
Nokia Maps.
•       Multiple map types optimised for mobile displays

•       “Out-of-the box” support for common mapping use cases
        (Markers, Images, Polygons, Polylines, Pan and Zoom)

•       In-built libraries to access search, routing and POI information
        services.

•       Façade Pattern - hides all the “plumbing” code - the low level
        connection calls, image manipulation etc.



Comes as standard as part of the Nokia SDK 2.0 for Java
http://www.developer.nokia.com/Develop/Java/Tools/
    4     © Nokia 2012 Creating Map Components for Touch.pptx
Architectural Design

•   MapCanvas - a concrete instantiation of the
    javax.microedition.lcdui.Canvas class. Handles
    the low-level graphics painting the map and the delivery
    of events .

•   MapDisplay – defines the part of the World to be
    displayed, and encapsulates the details of any custom
    points of interest. That is it contains MapObjects

•   MapObjects may be also be placed within a
    MapContainer

•   Use the MapFactory to create MapObjects and add them to the MapDisplay.

•   Both the MapDisplay and MapConatiners are themselves MapObjects




5     © Nokia 2012 Creating Map Components for Touch.pptx
An Introduction to Map
Components



6   © Nokia 2012 Creating Map Components for Touch.pptx
What is a Map component?
MapComponents are used to alter or extend the functionality of the basic map.
Five standard MapComponents already exist:

 Component        Function                                  Visible   Responds   Responds
 ID                                                                   to Touch   to Key
                                                                                 Press
 ZoomImg          Zooms the map when the on screen +/-
 Component        buttons are pressed.
 Touch            Zooms and Pans the map using gesture
 Behavior
 Download         Displays Memory usage on screen
 Indicator
 Default          Draws a focal point (bull's-eye) at the
 Cursor           center of the map screen
 Map              Zooms and Pans the map using Keypad
 Behavior


To include new functionality:

To remove existing functionality:


7     © Nokia 2012 Creating Map Components for Touch.pptx
Hello World Component
    What is it? The simplest introductory MapComponent

    What Events Does it consume ?
        • None

    What does it do?
           Paints Hello World over the top of the map
           (of course.)

           All visible MapComponents must be painted onto the
           MapCanvas

           Once a MapComponent has been attached, the
           paint() method will be called after the underlining
           MapDisplay has been rendered on the MapCanvas
           .




8      © Nokia 2012 Creating Map Components for Touch.pptx
Hello World Component
Any custom map component must implement the MapComponent interface,
hence at a minimum, the component must handle all the events shown below:

                                                           attach()and detach() are called when the component
                                                           is added/removed from the MapDisplay.



                                                           An EventListener is required for handling touch events
                                                           and key presses. This is optional.

                                                           For housekeeping, every component must offer a unique
                                                           Id and a version number.


                                                           mapUpdated()is called when the MapDisplay changes
                                                           state (Observer Pattern)




9    © Nokia 2012 Creating Map Components for Touch.pptx
Reacting to Map Events




10   © Nokia 2012 Creating Map Components for Touch.pptx
Reacting to Map Events
    All usable MapComponents must
    react to one or more events

•        Once attached MapComponents are able to
         respond to changes of the MapDisplay as
         well as the paint()event.

•        MapComponents with an EventListener
         are also able to respond touch events and key
         presses

•        When the attach()method is called,
         maintain a reference to the current
         MapDisplay, to be able to observe the
         details of the changes of state, alter the map
         and access the associated mapObjects



Every MapComponent should do this!

    11     © Nokia 2012 Creating Map Components for Touch.pptx
Map Restriction Component
 What is it? A visible fixed grey box, the User cannot
                          escape




 What Events Does it consume ?
               mapUpdated             Emits an audible warning if
                                      the user attempts to move the
                                      centre of the map outside of
                                      a given limit.


     What does it do?
           •      Prevents the User from moving the Map Outside of a
                  given GeoBoundingBox
           •      Facilitates the use of Viewport clustering

 Demo:          http://www.youtube.com/watch?v=zEShGKpesIw
                http://www.youtube.com/watch?v=QED-xV0rjbw
12     © Nokia 2012 Creating Map Components for Touch.pptx
Map Restriction Component
How does it work?

Interaction between the Map Restriction
Component and the Map Behaviour
Component

One Component = One Job

•        When the map is updated, the center is
         validated against a bounding box.

•        The Display (for playSound()) and
         MapListener (for repaint()) need
         to have been passed into the
         constructor.

•        The call to onMapContentUpdated()
         forces the map to be repainted:


    13     © Nokia 2012 Creating Map Components for Touch.pptx
Focal Observer Component
 What is it? Fires a listener function, informing the
 MIDlet that there is non-geographic data associated with
 the MapObject currently at the centre of the map.




 What Events Does it consume ?
       mapUpdated                     Checks to see if the MapObject at the
                                      centre of the screen has any associated
                                      non-geographic data, and passes it to its
                                      Listener.

 What does it do? Depends on the             MIDlet
         •      Usually used in conjunction with other Forms and MapComponents
         •      Similar to the onFocusChanged()callback of the KMLMapComponent

Demo:        http://www.youtube.com/watch?v=BUM-gEE_wXU
14   © Nokia 2012 Creating Map Components for Touch.pptx
Focal Observer Component
How does it work?
The MIDlet must offer a callback function of a well known interface, and
handle the data accordingly.




Relies on three useful functions:
      •     to find the MapObject at the centre of the MapDisplay



      •     to find the central GeoCoordinate of a MapObject



      •     to find the pixel Point at the centre of a MapObject


15   © Nokia 2012 Creating Map Components for Touch.pptx
Tooltip Component
 What is it? A static tooltip control




 What Events Does it consume ?
         mapUpdated                     Displays /Hides the tooltip control
                                        dependent upon the object at the centre
                                        of the screen.


 What does it do?
         •      Displays a tooltip text associated with a MapObject
         •      Gives Visual Feedback/Reassurance to the User prior to making a selection.
         •      Use in association with the Focal Observer and OK Command Button.

 Demo:        http://www.youtube.com/watch?v=MvlQoOmFt-Y

16   © Nokia 2012 Creating Map Components for Touch.pptx
Creating Touchable Map
Components



17   © Nokia 2012 Creating Map Components for Touch.pptx
Reacting to Touch
To react to touch events (and key presses) a MapComponent will need its own
EventListener. Pointer and Key Press Events created by the MapCanvas are passed
by each attached MapComponent in turn until the event has been consumed.

There are six types of event to process

      •     pointerPressed()                           •    keyPressed()
      •     pointerReleased()                          •    keyReleased()
      •     pointerDragged()                           •    keyRepeated()

 •   A typical touch control will process all three
     types of pointer event, but will usually only
     consume the pointerReleased()event.

 •   The type of processing to be done will depend
     upon whether the pointer was within the hit area
     of the control or not.

 •   All the Key press events should be left
     unconsumed. (i.e. return false)


18    © Nokia 2012 Creating Map Components for Touch.pptx
Centering Control
 What is it? A component adding a touch event to the map, centring/reacting to
             the marker touched.

 What Events Does it consume ?
        pointerReleased                         Moves the touched control to the centre of the screen,
                                                or fires a Command if the object is already at the centre
                                                of the screen.


     What does it do?
     • Used for object selection
     • Use in conjunction with Focal Observer and other
       feedback components e.g. Tooltip, Infobubble etc.

     Where is the Hit Area ?


 Demo:           http://www.youtube.com/watch?v=wtBHN2VhI2Q

19      © Nokia 2012 Creating Map Components for Touch.pptx
Infobubble Component
 What is it? A clickable, scrollable Infobubble control

 What Events Does it consume ?
         mapUpdated                     Displays the Infobubble control and hides
                                        the MapObject or vice-versa dependent
                                        upon the object at the centre of the
                                        screen.
         pointerPressed                 Highlights the InfoBubble
         clear                          Removes highlight
         pointerReleased                Fires the Command associated with the
                                        InfoBubble
         pointerDragged                 Drags the text within the Infobubble



 What does it do?
         •      Extension of the tooltip control. More visual feedback prior to selection

 Demo:        http://www.youtube.com/watch?v=MTRbpXkaGAk

20   © Nokia 2012 Creating Map Components for Touch.pptx
Adding Buttons to a Map Canvas




21   © Nokia 2012 Creating Map Components for Touch.pptx
Adding Buttons to a Map Canvas
•    Buttons are familiar visual components for users, who expect an event to
     be triggered when a defined area of the screen (i.e. the hit area) is touched

•    Each button on a MapCanvas will be a separate MapComponent which
     responds to touch events in a standard fashion and overrides paint()to
     render the button text, background and/or button glyph (Image).

• Standard conventions occur:
        •     With touch down, the button shows a highlight colour.
        •     With touch release, the action is triggered, and the highlight disappears.
        •     Highlight also disappears if release occurs outside of the hit area.

• Follow the Series 40 Full Touch Design Guidelines

• Buttons typically have a binary On/Off state.

• Don’t over use buttons – each button added reduces the area left to display
  the map.


22     © Nokia 2012 Creating Map Components for Touch.pptx
Scale Bar
 What is it? A dynamic text button

 What Events Does it consume ?
            pointerPressed                     Highlights the Button
            clear                              Removes highlight
            pointerReleased                    Removes highlight and switches
                                               between Metric and Imperial
                                               measurements
            mapUpdated                         Recalculates the length of the scale
                                               bar. Alters the legend based on the
                                               zoom level.


     What does it do?
             •      Displays a scale bar of a known length on the map with a legend in
                    Miles or Kilometers

 Demo:           http://www.youtube.com/watch?v=bbd_11Zx1ck

23     © Nokia 2012 Creating Map Components for Touch.pptx
Picture-in-Picture Button.
 What is it? A dynamic image button

 What Events Does it consume ?
          pointerPressed                   Highlight s the Image Button or the
                                           Pic-in-Pic Border if the control is active.
          clear                            Removes any highlighting
          pointerReleased                  Toggles Display of Pic-In-Pic
          mapUpdated                       Recalculates Pic-Pic based on the view
                                           on the screen


 What does it do?

         •      Displays a small zoomed out Image with a dot
                marking the current center point of the map.

Demo:         http://www.youtube.com/watch?v=qXwY0ja-Yno


24   © Nokia 2012 Creating Map Components for Touch.pptx
Map Selector Button.
 What is it? A static image button

 What Events Does it consume ?
             pointerPressed                Highlights the Image /
                                           Button
             clear                         Remove highlight
             pointerReleased               Removes highlight and
                                           shows/hides the Map
                                           Selector


 What does it do?

         •       Full Touch Phones – display and use a selection from a CategoryBar

         •      Fall back UI – Switch in a Modal Form as the current Display and make
                an Exclusive ChoiceGroup Selection

 Demo:        http://www.youtube.com/watch?v=KLFiPj7XJms
              http://www.youtube.com/watch?v=SOQRV5hp-E4
25   © Nokia 2012 Creating Map Components for Touch.pptx
Geolocation Button.
 What is it? A static image button

 What Events Does it consume ?
          pointerPressed                      Highlights the Image / Button
          clear                               Remove highlight
          pointerReleased                     Remove highlight and activates or
                                              deactivates the Geolocation API


 What does it do?

         •      Requests GPS updates or polls for Cell ID
                location and responds to location updates
                by placing a marker on the map.


 Demo:        http://www.youtube.com/watch?v=rtmSpk0vANo



26   © Nokia 2012 Creating Map Components for Touch.pptx
Adding Gesture Controls




27   © Nokia 2012 Creating Map Components for Touch.pptx
Reacting to Gesture
The Gesture API allows MIDlets to receive notifications when the user
interacts with Canvas. The API registers touch interaction as a series of
gesture events.

Can potentially handle the following Events:
•        GESTURE_TAP
•        GESTURE_LONG_PRESS
•        GESTURE_LONG_PRESS_REPEATED
•        GESTURE_DRAG
•        GESTURE_DROP
•        GESTURE_FLICK
•        GESTURE_PINCH
•        GESTURE_RECOGNITION_START
•        GESTURE_RECOGNITION_END

Need to set up our own CustomGestureHandler, pass in the Canvas,
implement a GestureListener

For details check out the Nokia Developer’s Guide:
http://www.developer.nokia.com/Resources/Library/Java/#!developers-
guides/ui-and-graphics/touch-ui/touch-interaction-in-series-40/using-
gestures.html

    28   © Nokia 2012 Creating Map Components for Touch.pptx
Creating a Gesture Framework
 GestureEvents                                              Pointer Events
The CustomGestureHandler must                               pointerPressed()
listen out for gestures actions and                         pointerReleased() and
pass them on to any attached Gesture                        pointerDragged() are
handling MapComponents                                      automatically sent to any
                                                            attached MapComponents
                                                            by the MapCanvas via the
                                                            standard EventListener
                                                            interface.




Create a well known interface such
as ExtendedEventListener to
receive and handle events like
flick(), longPress() and
pinch()


 29   © Nokia 2012 Creating Map Components for Touch.pptx
Long Press Component
 What is it? A control which reacts to the long press
             gesture from the Gesture API

 What Events Does it consume ?

            longPress                          Calculates the geolocation of the pixel
                                               touched by the long press action and
                                               fires the associated Command


     What does it do?
             •      Fires a Command if a Long Press has occurred,
                    and remembers the location of the position
                    touched
             •      Used as an input device.


 Demo:           http://www.youtube.com/watch?v=R_DKmMU04fw



30     © Nokia 2012 Creating Map Components for Touch.pptx
Context Menu Component
 What is it? A context menu

 What Events Does it consume ?
          pointerPressed                     Highlights the Menu Item selected
          clear                              Removes highlight from the Menu Item
                                             selected or closes the context menu.
          pointerReleased                    Fires the Command associated with a
                                             Menu item if selected
          pointerDragged                     Moves the list of visible Menu Items up
                                             or down
          mapUpdated                         Displays the Context Menu control if
                                             the associated MapObject lies at the
                                             centre of the screen
          flick                              Continues the movement of Menu
                                             Items based on the flick velocity

 What does it do?
         •      Displays a series of possible actions associate with a location.
 Demo:        http://www.youtube.com/watch?v=b2YKo8jnmug
31   © Nokia 2012 Creating Map Components for Touch.pptx
Retrofitting Touch Controls to
your App



32   © Nokia 2012 Creating Map Components for Touch.pptx
Touchable KML Demo
 •   Remove Default Cursor
 •   Remove Download Indicator
 •   Add Centerer Component
 •   Add Tooltips Component
 •   Add KMLMapComponent

 When focused Changed add the tooltip and OK Command




 •   Select items by touching a MapObject
 •   Drill down by by touching a MapObject or
     selecting the OK Command

Demo:      http://www.youtube.com/watch?v=_jownw6ESI4
33   © Nokia 2012 Creating Map Components for Touch.pptx
Touchable Places Demo
 •   Remove Default Cursor
 •   Remove Download Indicator
 •   Add Centerer Component
 •   Add FocalObserver Component
 •   Add ContextMenu Component
 •   Add Infobubble Component

 When a Search is completed, add the
 Places Data to the FocalObserver.




 Demo:        http://www.youtube.com/watch?v=33Zcpj3wqsM
34   © Nokia 2012 Creating Map Components for Touch.pptx
Touchable Places Demo
 When the FocalObserver fires - add the Place data to either the
 InfoBubble or the ContextMenu depending upon whether there are
 any contact details:




 User expects all MapObjects to be touchable. The visual feedback
 means that the user is always offered the correct control for touching
 or making a choice.

35   © Nokia 2012 Creating Map Components for Touch.pptx
Touchable Routing Demo
 •    Remove Default Cursor
 •    Remove Download Indicator
 •    Add Centerer Component
 •    Add LongPress Component
 •    Add SideBar Component


     Use the LongPress Component to add markers
     to the map.

     Sidebar component :
     • Familiar virtual keyboard style interface.
     • Draggable handle reveals touchable icons.
     • Shows/ Hides important Commands – no need
       to take screen space away from the map.
     • Maximum of four choices in landscape mode

 Demo:          http://www.youtube.com/watch?v=6Ss07MgkrBk


36     © Nokia 2012 Creating Map Components for Touch.pptx
For More Information
     Download the latest Nokia SDK for Java
     http://developer.nokia.com/Develop/Series_40

     Consult the Nokia Developer Library
     http://library.developer.nokia.com

     Nokia Maps API
     http://api.maps.nokia.com

     Download the Map Components
     https://projects.developer.nokia.com/mapcomponentdemos




37     © Nokia 2012 Creating Map Components for Touch.pptx

Contenu connexe

Similaire à Optimise Nokia Maps applications for Nokia Asha Touch phones

Dojo 1.7 mobile overview dojo conf 2011
Dojo 1.7 mobile overview  dojo conf 2011Dojo 1.7 mobile overview  dojo conf 2011
Dojo 1.7 mobile overview dojo conf 2011ccmitchellusa
 
Developing For Android Wear - Part 2
Developing For Android Wear - Part 2Developing For Android Wear - Part 2
Developing For Android Wear - Part 2Justin Munger
 
Dynamic Graph Plotting with WPF
Dynamic Graph Plotting with WPFDynamic Graph Plotting with WPF
Dynamic Graph Plotting with WPFIJERD Editor
 
android-tutorial-for-beginner
android-tutorial-for-beginnerandroid-tutorial-for-beginner
android-tutorial-for-beginnerAjailal Parackal
 
iOS Development (Part 3) - Additional GUI Components
iOS Development (Part 3) - Additional GUI ComponentsiOS Development (Part 3) - Additional GUI Components
iOS Development (Part 3) - Additional GUI ComponentsAsim Rais Siddiqui
 
GUI Programming using Tkinter-converted.pptx
GUI Programming using Tkinter-converted.pptxGUI Programming using Tkinter-converted.pptx
GUI Programming using Tkinter-converted.pptxdvarshitha04
 
Location and API Maps in Windows Phone 8
Location and API Maps in Windows Phone 8Location and API Maps in Windows Phone 8
Location and API Maps in Windows Phone 8Antonio Pelleriti
 
Post rendering
Post renderingPost rendering
Post renderingAkilarLiao
 
PEUDOM: a Platform for End User Development Of Mashups
PEUDOM: a Platform for End User Development Of MashupsPEUDOM: a Platform for End User Development Of Mashups
PEUDOM: a Platform for End User Development Of MashupsMatteo Picozzi
 
Google Glass Development Kit - Developer Zone
Google Glass Development Kit - Developer ZoneGoogle Glass Development Kit - Developer Zone
Google Glass Development Kit - Developer ZoneUtpal Betai
 
Slot04 creating gui
Slot04 creating guiSlot04 creating gui
Slot04 creating guiViên Mai
 
Modern app development with Jetpack Compose.pptx
Modern app development with Jetpack Compose.pptxModern app development with Jetpack Compose.pptx
Modern app development with Jetpack Compose.pptxMd Shamsul Arafin Mahtab
 
Geopaparazzi state of the art
Geopaparazzi state of the artGeopaparazzi state of the art
Geopaparazzi state of the artsilli
 

Similaire à Optimise Nokia Maps applications for Nokia Asha Touch phones (20)

Dojo 1.7 mobile overview dojo conf 2011
Dojo 1.7 mobile overview  dojo conf 2011Dojo 1.7 mobile overview  dojo conf 2011
Dojo 1.7 mobile overview dojo conf 2011
 
Unit 2
Unit 2Unit 2
Unit 2
 
Developing For Android Wear - Part 2
Developing For Android Wear - Part 2Developing For Android Wear - Part 2
Developing For Android Wear - Part 2
 
Intro to apps with maps for series 40
Intro to apps with maps for series 40Intro to apps with maps for series 40
Intro to apps with maps for series 40
 
Dynamic Graph Plotting with WPF
Dynamic Graph Plotting with WPFDynamic Graph Plotting with WPF
Dynamic Graph Plotting with WPF
 
android-tutorial-for-beginner
android-tutorial-for-beginnerandroid-tutorial-for-beginner
android-tutorial-for-beginner
 
Interactive map
Interactive mapInteractive map
Interactive map
 
Hello world ios v1
Hello world ios v1Hello world ios v1
Hello world ios v1
 
Swift
SwiftSwift
Swift
 
iOS Development (Part 3) - Additional GUI Components
iOS Development (Part 3) - Additional GUI ComponentsiOS Development (Part 3) - Additional GUI Components
iOS Development (Part 3) - Additional GUI Components
 
GUI Programming using Tkinter-converted.pptx
GUI Programming using Tkinter-converted.pptxGUI Programming using Tkinter-converted.pptx
GUI Programming using Tkinter-converted.pptx
 
Location and API Maps in Windows Phone 8
Location and API Maps in Windows Phone 8Location and API Maps in Windows Phone 8
Location and API Maps in Windows Phone 8
 
Post rendering
Post renderingPost rendering
Post rendering
 
PEUDOM: a Platform for End User Development Of Mashups
PEUDOM: a Platform for End User Development Of MashupsPEUDOM: a Platform for End User Development Of Mashups
PEUDOM: a Platform for End User Development Of Mashups
 
Google Glass Development Kit - Developer Zone
Google Glass Development Kit - Developer ZoneGoogle Glass Development Kit - Developer Zone
Google Glass Development Kit - Developer Zone
 
Slot04 creating gui
Slot04 creating guiSlot04 creating gui
Slot04 creating gui
 
Designing Apps for the Motorola XOOM
Designing Apps for the Motorola XOOM Designing Apps for the Motorola XOOM
Designing Apps for the Motorola XOOM
 
2D graphics
2D graphics2D graphics
2D graphics
 
Modern app development with Jetpack Compose.pptx
Modern app development with Jetpack Compose.pptxModern app development with Jetpack Compose.pptx
Modern app development with Jetpack Compose.pptx
 
Geopaparazzi state of the art
Geopaparazzi state of the artGeopaparazzi state of the art
Geopaparazzi state of the art
 

Plus de Microsoft Mobile Developer

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 toolsMicrosoft Mobile Developer
 
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 Geo2tagMicrosoft Mobile Developer
 
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 consultationsMicrosoft Mobile Developer
 
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 appMicrosoft Mobile Developer
 
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 storeMicrosoft Mobile Developer
 
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 progettoMicrosoft Mobile Developer
 

Plus de 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
 

Dernier

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 

Dernier (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
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...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
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
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 

Optimise Nokia Maps applications for Nokia Asha Touch phones

  • 1. Nokia Series 40 Optimizing Nokia Map Applications for Series 40 Touch Devices Jason Fox Technical Support Engineer Maps Platform 1 © Nokia 2012 Creating Map Components for Touch.pptx
  • 2. Agenda 1. Architectural Overview of the Nokia Maps API for Java ME. 2. An Introduction to Map Components 3. Reacting to Map Events 4. Creating Touchable Map Components 5. Adding Buttons to a Map Canvas 6. Adding Gesture Controls 7. Retrofitting Touch Controls to your App Note: A complete set of video demos is available at: http://www.youtube.com/watch?v=P3qfd7_OrpY 2 © Nokia 2012 Creating Map Components for Touch.pptx
  • 3. Architectural Overview of the Nokia Maps API for Java ME 3 © Nokia 2012 Creating Map Components for Touch.pptx
  • 4. What is Nokia Maps API for Java ME? An extendable API aimed at Series 40 Phones, targeting all devices supporting MIDP 2.0 or higher. Allows you to develop mobile applications based on Nokia Maps. • Multiple map types optimised for mobile displays • “Out-of-the box” support for common mapping use cases (Markers, Images, Polygons, Polylines, Pan and Zoom) • In-built libraries to access search, routing and POI information services. • Façade Pattern - hides all the “plumbing” code - the low level connection calls, image manipulation etc. Comes as standard as part of the Nokia SDK 2.0 for Java http://www.developer.nokia.com/Develop/Java/Tools/ 4 © Nokia 2012 Creating Map Components for Touch.pptx
  • 5. Architectural Design • MapCanvas - a concrete instantiation of the javax.microedition.lcdui.Canvas class. Handles the low-level graphics painting the map and the delivery of events . • MapDisplay – defines the part of the World to be displayed, and encapsulates the details of any custom points of interest. That is it contains MapObjects • MapObjects may be also be placed within a MapContainer • Use the MapFactory to create MapObjects and add them to the MapDisplay. • Both the MapDisplay and MapConatiners are themselves MapObjects 5 © Nokia 2012 Creating Map Components for Touch.pptx
  • 6. An Introduction to Map Components 6 © Nokia 2012 Creating Map Components for Touch.pptx
  • 7. What is a Map component? MapComponents are used to alter or extend the functionality of the basic map. Five standard MapComponents already exist: Component Function Visible Responds Responds ID to Touch to Key Press ZoomImg Zooms the map when the on screen +/- Component buttons are pressed. Touch Zooms and Pans the map using gesture Behavior Download Displays Memory usage on screen Indicator Default Draws a focal point (bull's-eye) at the Cursor center of the map screen Map Zooms and Pans the map using Keypad Behavior To include new functionality: To remove existing functionality: 7 © Nokia 2012 Creating Map Components for Touch.pptx
  • 8. Hello World Component What is it? The simplest introductory MapComponent What Events Does it consume ? • None What does it do? Paints Hello World over the top of the map (of course.) All visible MapComponents must be painted onto the MapCanvas Once a MapComponent has been attached, the paint() method will be called after the underlining MapDisplay has been rendered on the MapCanvas . 8 © Nokia 2012 Creating Map Components for Touch.pptx
  • 9. Hello World Component Any custom map component must implement the MapComponent interface, hence at a minimum, the component must handle all the events shown below: attach()and detach() are called when the component is added/removed from the MapDisplay. An EventListener is required for handling touch events and key presses. This is optional. For housekeeping, every component must offer a unique Id and a version number. mapUpdated()is called when the MapDisplay changes state (Observer Pattern) 9 © Nokia 2012 Creating Map Components for Touch.pptx
  • 10. Reacting to Map Events 10 © Nokia 2012 Creating Map Components for Touch.pptx
  • 11. Reacting to Map Events All usable MapComponents must react to one or more events • Once attached MapComponents are able to respond to changes of the MapDisplay as well as the paint()event. • MapComponents with an EventListener are also able to respond touch events and key presses • When the attach()method is called, maintain a reference to the current MapDisplay, to be able to observe the details of the changes of state, alter the map and access the associated mapObjects Every MapComponent should do this! 11 © Nokia 2012 Creating Map Components for Touch.pptx
  • 12. Map Restriction Component What is it? A visible fixed grey box, the User cannot escape What Events Does it consume ? mapUpdated Emits an audible warning if the user attempts to move the centre of the map outside of a given limit. What does it do? • Prevents the User from moving the Map Outside of a given GeoBoundingBox • Facilitates the use of Viewport clustering Demo: http://www.youtube.com/watch?v=zEShGKpesIw http://www.youtube.com/watch?v=QED-xV0rjbw 12 © Nokia 2012 Creating Map Components for Touch.pptx
  • 13. Map Restriction Component How does it work? Interaction between the Map Restriction Component and the Map Behaviour Component One Component = One Job • When the map is updated, the center is validated against a bounding box. • The Display (for playSound()) and MapListener (for repaint()) need to have been passed into the constructor. • The call to onMapContentUpdated() forces the map to be repainted: 13 © Nokia 2012 Creating Map Components for Touch.pptx
  • 14. Focal Observer Component What is it? Fires a listener function, informing the MIDlet that there is non-geographic data associated with the MapObject currently at the centre of the map. What Events Does it consume ? mapUpdated Checks to see if the MapObject at the centre of the screen has any associated non-geographic data, and passes it to its Listener. What does it do? Depends on the MIDlet • Usually used in conjunction with other Forms and MapComponents • Similar to the onFocusChanged()callback of the KMLMapComponent Demo: http://www.youtube.com/watch?v=BUM-gEE_wXU 14 © Nokia 2012 Creating Map Components for Touch.pptx
  • 15. Focal Observer Component How does it work? The MIDlet must offer a callback function of a well known interface, and handle the data accordingly. Relies on three useful functions: • to find the MapObject at the centre of the MapDisplay • to find the central GeoCoordinate of a MapObject • to find the pixel Point at the centre of a MapObject 15 © Nokia 2012 Creating Map Components for Touch.pptx
  • 16. Tooltip Component What is it? A static tooltip control What Events Does it consume ? mapUpdated Displays /Hides the tooltip control dependent upon the object at the centre of the screen. What does it do? • Displays a tooltip text associated with a MapObject • Gives Visual Feedback/Reassurance to the User prior to making a selection. • Use in association with the Focal Observer and OK Command Button. Demo: http://www.youtube.com/watch?v=MvlQoOmFt-Y 16 © Nokia 2012 Creating Map Components for Touch.pptx
  • 17. Creating Touchable Map Components 17 © Nokia 2012 Creating Map Components for Touch.pptx
  • 18. Reacting to Touch To react to touch events (and key presses) a MapComponent will need its own EventListener. Pointer and Key Press Events created by the MapCanvas are passed by each attached MapComponent in turn until the event has been consumed. There are six types of event to process • pointerPressed() • keyPressed() • pointerReleased() • keyReleased() • pointerDragged() • keyRepeated() • A typical touch control will process all three types of pointer event, but will usually only consume the pointerReleased()event. • The type of processing to be done will depend upon whether the pointer was within the hit area of the control or not. • All the Key press events should be left unconsumed. (i.e. return false) 18 © Nokia 2012 Creating Map Components for Touch.pptx
  • 19. Centering Control What is it? A component adding a touch event to the map, centring/reacting to the marker touched. What Events Does it consume ? pointerReleased Moves the touched control to the centre of the screen, or fires a Command if the object is already at the centre of the screen. What does it do? • Used for object selection • Use in conjunction with Focal Observer and other feedback components e.g. Tooltip, Infobubble etc. Where is the Hit Area ? Demo: http://www.youtube.com/watch?v=wtBHN2VhI2Q 19 © Nokia 2012 Creating Map Components for Touch.pptx
  • 20. Infobubble Component What is it? A clickable, scrollable Infobubble control What Events Does it consume ? mapUpdated Displays the Infobubble control and hides the MapObject or vice-versa dependent upon the object at the centre of the screen. pointerPressed Highlights the InfoBubble clear Removes highlight pointerReleased Fires the Command associated with the InfoBubble pointerDragged Drags the text within the Infobubble What does it do? • Extension of the tooltip control. More visual feedback prior to selection Demo: http://www.youtube.com/watch?v=MTRbpXkaGAk 20 © Nokia 2012 Creating Map Components for Touch.pptx
  • 21. Adding Buttons to a Map Canvas 21 © Nokia 2012 Creating Map Components for Touch.pptx
  • 22. Adding Buttons to a Map Canvas • Buttons are familiar visual components for users, who expect an event to be triggered when a defined area of the screen (i.e. the hit area) is touched • Each button on a MapCanvas will be a separate MapComponent which responds to touch events in a standard fashion and overrides paint()to render the button text, background and/or button glyph (Image). • Standard conventions occur: • With touch down, the button shows a highlight colour. • With touch release, the action is triggered, and the highlight disappears. • Highlight also disappears if release occurs outside of the hit area. • Follow the Series 40 Full Touch Design Guidelines • Buttons typically have a binary On/Off state. • Don’t over use buttons – each button added reduces the area left to display the map. 22 © Nokia 2012 Creating Map Components for Touch.pptx
  • 23. Scale Bar What is it? A dynamic text button What Events Does it consume ? pointerPressed Highlights the Button clear Removes highlight pointerReleased Removes highlight and switches between Metric and Imperial measurements mapUpdated Recalculates the length of the scale bar. Alters the legend based on the zoom level. What does it do? • Displays a scale bar of a known length on the map with a legend in Miles or Kilometers Demo: http://www.youtube.com/watch?v=bbd_11Zx1ck 23 © Nokia 2012 Creating Map Components for Touch.pptx
  • 24. Picture-in-Picture Button. What is it? A dynamic image button What Events Does it consume ? pointerPressed Highlight s the Image Button or the Pic-in-Pic Border if the control is active. clear Removes any highlighting pointerReleased Toggles Display of Pic-In-Pic mapUpdated Recalculates Pic-Pic based on the view on the screen What does it do? • Displays a small zoomed out Image with a dot marking the current center point of the map. Demo: http://www.youtube.com/watch?v=qXwY0ja-Yno 24 © Nokia 2012 Creating Map Components for Touch.pptx
  • 25. Map Selector Button. What is it? A static image button What Events Does it consume ? pointerPressed Highlights the Image / Button clear Remove highlight pointerReleased Removes highlight and shows/hides the Map Selector What does it do? • Full Touch Phones – display and use a selection from a CategoryBar • Fall back UI – Switch in a Modal Form as the current Display and make an Exclusive ChoiceGroup Selection Demo: http://www.youtube.com/watch?v=KLFiPj7XJms http://www.youtube.com/watch?v=SOQRV5hp-E4 25 © Nokia 2012 Creating Map Components for Touch.pptx
  • 26. Geolocation Button. What is it? A static image button What Events Does it consume ? pointerPressed Highlights the Image / Button clear Remove highlight pointerReleased Remove highlight and activates or deactivates the Geolocation API What does it do? • Requests GPS updates or polls for Cell ID location and responds to location updates by placing a marker on the map. Demo: http://www.youtube.com/watch?v=rtmSpk0vANo 26 © Nokia 2012 Creating Map Components for Touch.pptx
  • 27. Adding Gesture Controls 27 © Nokia 2012 Creating Map Components for Touch.pptx
  • 28. Reacting to Gesture The Gesture API allows MIDlets to receive notifications when the user interacts with Canvas. The API registers touch interaction as a series of gesture events. Can potentially handle the following Events: • GESTURE_TAP • GESTURE_LONG_PRESS • GESTURE_LONG_PRESS_REPEATED • GESTURE_DRAG • GESTURE_DROP • GESTURE_FLICK • GESTURE_PINCH • GESTURE_RECOGNITION_START • GESTURE_RECOGNITION_END Need to set up our own CustomGestureHandler, pass in the Canvas, implement a GestureListener For details check out the Nokia Developer’s Guide: http://www.developer.nokia.com/Resources/Library/Java/#!developers- guides/ui-and-graphics/touch-ui/touch-interaction-in-series-40/using- gestures.html 28 © Nokia 2012 Creating Map Components for Touch.pptx
  • 29. Creating a Gesture Framework GestureEvents Pointer Events The CustomGestureHandler must pointerPressed() listen out for gestures actions and pointerReleased() and pass them on to any attached Gesture pointerDragged() are handling MapComponents automatically sent to any attached MapComponents by the MapCanvas via the standard EventListener interface. Create a well known interface such as ExtendedEventListener to receive and handle events like flick(), longPress() and pinch() 29 © Nokia 2012 Creating Map Components for Touch.pptx
  • 30. Long Press Component What is it? A control which reacts to the long press gesture from the Gesture API What Events Does it consume ? longPress Calculates the geolocation of the pixel touched by the long press action and fires the associated Command What does it do? • Fires a Command if a Long Press has occurred, and remembers the location of the position touched • Used as an input device. Demo: http://www.youtube.com/watch?v=R_DKmMU04fw 30 © Nokia 2012 Creating Map Components for Touch.pptx
  • 31. Context Menu Component What is it? A context menu What Events Does it consume ? pointerPressed Highlights the Menu Item selected clear Removes highlight from the Menu Item selected or closes the context menu. pointerReleased Fires the Command associated with a Menu item if selected pointerDragged Moves the list of visible Menu Items up or down mapUpdated Displays the Context Menu control if the associated MapObject lies at the centre of the screen flick Continues the movement of Menu Items based on the flick velocity What does it do? • Displays a series of possible actions associate with a location. Demo: http://www.youtube.com/watch?v=b2YKo8jnmug 31 © Nokia 2012 Creating Map Components for Touch.pptx
  • 32. Retrofitting Touch Controls to your App 32 © Nokia 2012 Creating Map Components for Touch.pptx
  • 33. Touchable KML Demo • Remove Default Cursor • Remove Download Indicator • Add Centerer Component • Add Tooltips Component • Add KMLMapComponent When focused Changed add the tooltip and OK Command • Select items by touching a MapObject • Drill down by by touching a MapObject or selecting the OK Command Demo: http://www.youtube.com/watch?v=_jownw6ESI4 33 © Nokia 2012 Creating Map Components for Touch.pptx
  • 34. Touchable Places Demo • Remove Default Cursor • Remove Download Indicator • Add Centerer Component • Add FocalObserver Component • Add ContextMenu Component • Add Infobubble Component When a Search is completed, add the Places Data to the FocalObserver. Demo: http://www.youtube.com/watch?v=33Zcpj3wqsM 34 © Nokia 2012 Creating Map Components for Touch.pptx
  • 35. Touchable Places Demo When the FocalObserver fires - add the Place data to either the InfoBubble or the ContextMenu depending upon whether there are any contact details: User expects all MapObjects to be touchable. The visual feedback means that the user is always offered the correct control for touching or making a choice. 35 © Nokia 2012 Creating Map Components for Touch.pptx
  • 36. Touchable Routing Demo • Remove Default Cursor • Remove Download Indicator • Add Centerer Component • Add LongPress Component • Add SideBar Component Use the LongPress Component to add markers to the map. Sidebar component : • Familiar virtual keyboard style interface. • Draggable handle reveals touchable icons. • Shows/ Hides important Commands – no need to take screen space away from the map. • Maximum of four choices in landscape mode Demo: http://www.youtube.com/watch?v=6Ss07MgkrBk 36 © Nokia 2012 Creating Map Components for Touch.pptx
  • 37. For More Information Download the latest Nokia SDK for Java http://developer.nokia.com/Develop/Series_40 Consult the Nokia Developer Library http://library.developer.nokia.com Nokia Maps API http://api.maps.nokia.com Download the Map Components https://projects.developer.nokia.com/mapcomponentdemos 37 © Nokia 2012 Creating Map Components for Touch.pptx