SlideShare a Scribd company logo
1 of 36
Download to read offline
Nokia Series 40

Application Development and
Design with the Nokia Maps API
for Java ME on Series 40 phones


Jason Fox
Technical Support Engineer
Maps Platform
1   © Nokia 2012 Advanced Maps on Apps.pptx
Agenda
1. Brief Overview of the Nokia Maps API
   for Java ME.
2. Where to store your Geographic data
3. Data Feeds (JSON + XML)
4. Parsing Data from a Web Service
5. KML
6. Overlays


2   © Nokia 2012 Advanced Maps on Apps.pptx
A Brief Overview of the Nokia
Maps API for Java ME



3   © Nokia 2012 Advanced Maps on Apps.pptx
What is Nokia Maps API for Java ME?
•       API aimed at Series 40 Phones. Allows you to
        develop mobile applications based on Nokia
        Maps.

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

•       Targets devices supporting MIDP 2.0 or higher.

•       Not currently part of the SDK

•       Single downloadable JAR around 150 kB.

•       Faster App development. Better App performance

Full details at :
http://www.developer.nokia.com/Develop/Maps/Maps_API_for_Java_ME/

    4     © Nokia 2012 Advanced Maps on Apps.pptx
What Features does the API have?
• Interactive Maps on Series 40
  phones
     • Multiple map types
     • Multiple languages available

• Markers, Images, Polygons,
  Polylines, Pan and Zoom.

• Search, routing and POI information
  services.

• Open to extension

5   © Nokia 2012 Advanced Maps on Apps.pptx
What problems does the API
solve?
      or

        “Why your S40 Map App should use
        the Nokia Maps API for Java ME”




6   © Nokia 2012 Advanced Maps on Apps.pptx
What problems does the API solve? (1)
• Series 40 Phones
    • Small Screen Size
    • Typical phone does not have onboard maps.

• Nokia Maps are Mobile Optimised
    • Reduced clutter on screen
    • Large Fonts Readable on Small Display
    • Lower Colour Saturation
    • Pan and Zoom Pass control to the User to get Context on the
       Map
    • Map tiling and caching for low latency and reduced network
       traffic




7   © Nokia 2012 Advanced Maps on Apps.pptx
What problems does the API solve? (2)
Opportunities
• Introduce geographic context to your information.
• Displaying an interactive Map

You have :
• Geographical Information that you wish to show in context.

You want:
• A convenient front-end Presentation Layer for displaying your
  information.
     • MapDisplay to get the right Map on the screen
     • MapObjects to overlay this Map with your information
     • MapComponents to extend and interact with your
        information


8   © Nokia 2012 Advanced Maps on Apps.pptx
What problems does the API solve? (3)
Opportunities
• The ability to enhance your application through
  accessing additional API services
     • Search
     • Places
     • Routing


• Able to display complex data sets whilst
  reducing development time
    • Overlays
    • KML Support




9   © Nokia 2012 Advanced Maps on Apps.pptx
Storing, Obtaining and
Displaying Data for your
Map-based Application



10   © Nokia 2012 Advanced Maps on Apps.pptx
The Generic Use Case for a Map Based
Application
 A typical Map-based application will:
 • Obtain application data from somewhere (e.g. a Web service)
 • Display a map with associated Map Markers
 • When the user clicks on a map marker the app will a display more
    information associated with that location on a separate screen.




 Why use a map-based interface?
 • Familiar Paradigm
 • Intuitive
 • Easy to use


11   © Nokia 2012 Advanced Maps on Apps.pptx
What design does this indicate? (1)
In the generic use case:
• the data could come from anywhere
• the data could be in any format.

Hence none of this is wired up automatically. You have to plug it in
yourself.

But there is one constant across the data for every map based
application:

     “Every datum point will consist of both
     geographic and non geographic information”



12   © Nokia 2012 Advanced Maps on Apps.pptx
What design does this indicate? (2)
From the geographic information:
• Create a GeoCoordinate from the longitude/latitude associated with
   each datum point.
• Add a marker to the map to highlight the location of the GeoCoordinate
   using either a MapStandardMarker or a MapMarker




From the non-geographic information:
• Use a Hashtable to associate the MapMarker with the non-geographic
   information.




13   © Nokia 2012 Advanced Maps on Apps.pptx
What design does this indicate? (3)
Whenever interaction occurs, the app needs to :

• Check if a marker has been “clicked”

• Retrieve the associated non-geographic
  information from the Hashtable

• Do any necessary additional operations




14   © Nokia 2012 Advanced Maps on Apps.pptx
Where does the app get its data from?
Data can be conveniently split into two types:
         Static Data
         • Fixed, unchanging
         • Can be bundled with the App
         • No need for a data connection


                                               Dynamic Data
                                               • Volatile, unreliable
                                               • Keeps the App relevant
                                               • Needs to be requested from
                                                 a web service

Avoid the overhead of dynamic data wherever possible, but you will
need to go online anyway since the maps require a data connection

15   © Nokia 2012 Advanced Maps on Apps.pptx
How dynamic is your dynamic data?
Completely Static Data e.g. Quiz App - “Capitals of the World”
•        Bundle data with app

Long Period Data e.g. “Festival 2012”
•        Bundle data with app, update app version next year.

Short Period Data e.g. “Tourist Guide for …”
•        Read once then store and retrieve from device


Daily Data e.g. “Deals for Today …”
•        Read online summary once on start up.
•        May need to request more details later


Real Time Updates e.g. “Social Media”
•        Poll online for limited data summaries


    16     © Nokia 2012 Advanced Maps on Apps.pptx
Data Feeds and Formats




17   © Nokia 2012 Advanced Maps on Apps.pptx
Data Feeds
There are currently two popular alternative data formats for
transmitting structured data over a network connection. Both are
language independent and text based.

JSON http://json.org
• Syntax is derived from JavaScript
• Structure is defined through the use of brackets [{]}
• Objects are mapped as key-value pairs separated by a colon :

XML http://www.w3.org/TR/REC-xml
• Syntax is defined by the World Wide Web Consortium
• Structure consists of nesting elements with matching start and end tags.
• Objects are defined as the content between the tags and any attributes
  (key-value pairs) associated to the element.



18   © Nokia 2012 Advanced Maps on Apps.pptx
JSON Data Format




Data received will be a consistent format which may contain
• key-value pairs - “name”
• arrays of elements - “coordinates”
• complex types - “geo”

19   © Nokia 2012 Advanced Maps on Apps.pptx
XML Data Format




• Simple key-value pairs are held within a single pair of tags - <name>

• Complex elements may have attributes - <geo>

• Arrays may be build up from multiple elements with the same name.
  Conventionally array elements are given plural names - for example,
  the <results> element contains a series of <result> elements

20   © Nokia 2012 Advanced Maps on Apps.pptx
Parsing and Displaying Data
from a Web Service
       or

         “Getting your map data on screen
         the hard way”




21   © Nokia 2012 Advanced Maps on Apps.pptx
Parsing JSON Data
No standard JSON parser library available. Need to write your own.
Hint: An Example JSON parser can be found bundled with the API examples

• Parser will typically place all JSON objects into a Hashtable , need to
  extract the entries you require by either:

      •    casting directly (for simple types) e.g. key-value pairs

      •    building up more complex element step by step




Still have to know the data structure, names of entries and so on.
… and then create your MapMarkers, and data associations etc.



22   © Nokia 2012 Advanced Maps on Apps.pptx
Parsing XML Data
A Standard SAX parser implementation of JSR 172 comes as part of the
Java ME Web Services Optional package. It will fire events as the XML is
processed. Override these events to process your data.

      •    startElement() fired whenever the parser encounters an opening <tag>




      •    characters() occurs for all text within the <tag>…</tag>




      •      endElement() fired whenever the parser encounters a closing </tag>




Still have to know the data structure, element qnames, attributes and so
on … and finally create your MapMarkers, and data associations etc…

23   © Nokia 2012 Advanced Maps on Apps.pptx
An Ideal Data Format
Wouldn’t it be more convenient if there existed a data format that:

• Used a standard on-board parsing library like XML?

• Had a standardised data structure so that I wouldn’t need to modify my
  parsing code for each implementation?

• Created and styled MapObjects directly from the data feed?

• Automatically associated each MapObject with its
  non-geographic data?

• Worked just as well on the web as on the
  device?


                             This is KML
24   © Nokia 2012 Advanced Maps on Apps.pptx
What is KML?
KML http://www.opengeospatial.org/standards/kml/

Keyhole Markup Language (KML) is an standardized XML notation for
geographic applications.

KML is able to:
•        Specify icons and labels to identify locations.
•        Specify additional information (e.g. address, phone number) associated with a specific
         location.
•        Define other elements such as polygons and polylines and attach them to the map.
•        Define styles to specify feature appearance.
•        Write HTML descriptions of features, including hyperlinks and embedded images
•        Use folders for hierarchical grouping of features

Most importantly a KML Parser already exists within the Maps API for Java ME.
No need to write your own parser. No need to write custom code to display and
interact with your data.

    25     © Nokia 2012 Advanced Maps on Apps.pptx
KML Data Format




• Exactly the same structure as any XML document
      •    KML is a subset of XML

• The names of each element in the KML feed are strictly defined
      •    the longitude/latitude must be a value held in a <coordinates> tag.
      •    for a point of interest this is enclosed in a <Point> tag.
      •    Every item on the map is defined inside a <Placemark> tag.




26   © Nokia 2012 Advanced Maps on Apps.pptx
The Relationship between MapObjects
and KML Elements
Many MapObjects have a direct equivalent in KML

     Nokia Maps API                       KML                KML            KML
     for Java ME                          Feature            Geometry       Style
     MapStandard                          <Placemark>        <Point>
     Marker                                  (with
                                          <styleUrl>)
     MapMarker                            <Placemark>        <Point>        <IconStyle>

     MapPolyline                          <Placemark>        <LineString>   <LineStyle>

     MapPolygon                           <Placemark>        <Polygon>      <PolyStyle>

     MapContainer                         <Folder> or
                                                <Document>
For parsed elements such as <description>, <phoneNumber> and
<extendedData> where no direct equivalent object exists, the API will give
access to the parsed KML data in the Feature interface.

27    © Nokia 2012 Advanced Maps on Apps.pptx
Parsing and Displaying KML
Data
  or

         “Getting your map data on screen
         the easy way”




28   © Nokia 2012 Advanced Maps on Apps.pptx
Parsing and Displaying a KML File (1)
1)        Implement a KMLParserListener and a KMLFactoryListener, create a
          KMLManager and call parseKML()- This will create a KML Document




2)        Handle Success and Failure.
             If successful, convert the KML Document into a KMLResultSet by
             calling KMLFactory.createMLResultSet()passing in the received
             KML Document.




     29     © Nokia 2012 Advanced Maps on Apps.pptx
Parsing and Displaying a KML File (2)
3)   Handle Success and Failure.
             If successful, the KMLResultSet.getContainer() will hold a
             MapContainer which has all your map data as MapObjects. You can
             add it to the MapDisplay in the usual manner, and zoom as necessary




4) Add Interactive KMLMapComponent as necessary.
             The KMLResultSet.getKMLMapComponent()
             will highlight styled <Placemark> elements
             when they are at the center of the screen, the
             KMLMapComponent needs to be added to the
             MapDisplay to do this.




30   © Nokia 2012 Advanced Maps on Apps.pptx
Interacting with KML File Data
5)        To receive onFocusChanged()events and interact with the <Placemark>
          elements, you will need to implement a KMLEventListener


6)        Attach the KMLEventListener to the KMLMapComponent of your result set.
          This obtained from KMLResultSet.getKMLMapComponent()




7)        An onFocusChanged()event is fired whenever a <Placemark> is moved
          onto or away from the center of the MapDisplay.




If you want to interact with other <Placemark> elements, you will have to iterate
through KMLResultSet.getFeatures().

     31     © Nokia 2012 Advanced Maps on Apps.pptx
Displaying Complex Datasets
An Introduction to Overlays




32   © Nokia 2012 Advanced Maps on Apps.pptx
How Map Providers and Overlays Work
• For the base map providers, the globe is divided into
  individual map tiles. These are retrieved online from
  Nokia’s map tile service.
                                                                                            Base Map Tiles
      •      At minimum zoom, the world is contained in a single 128x128 pixel tile.
      •      At the next zoom level up, the world is 2 tiles wide and 2 tiles high. Then
             4x4, 8x8, 16x16 etc.                                                               +
      •      Each zoom level splits the tiles in two, doubling the number of tiles across
             the width and height
      •      Each Map is based on the Normalized Mercator projection.

                                                                                            Overlay Tiles
• Overlays work in the same fashion - using your own map
  tile server complex visual data can be displayed at                                           =
  different zoom levels.
      •      One tile at minimum zoom, then 2x2, 4x4 and so on.
      •      Must be based on the Normalized Mercator projection.
                                                                                                Result
      •      Use PNG tiles to support transparency, so underlying map can be seen
             beneath your data.

33   © Nokia 2012 Advanced Maps on Apps.pptx
Implementing a MapURLProvider (1)
1)        To create your own overlay provider, create a subclass of MapURLProvider




2)        Implement the necessary abstract methods.




3)        Then add the overlay to the MapDisplay


4)        Don’t forget Overlay attribution if necessary.


     34     © Nokia 2012 Advanced Maps on Apps.pptx
Implementing MapURLProvider (2)
Necessary Overrides

•    String getTileUrl()
       • Used to create the URL in order to download an overlay map tile.
       • Map tile service requests are typically of the format:
          http://map_tiler_url/x_tile/y_tile/zoom_level/format.png

•    boolean isTileSupported()
       • Decides whether to make an http request to download the tile.
       • The API will throw onMapUpdateError()if a tile cannot be downloaded.

Optional Overrides

•    Image decode(byte[] data)
        • May be used for image post processing (e.g. scaling up images)

•    String getMimeType()
        • Default is PNG - override if Map tile service is not returning PNG images.


35     © Nokia 2012 Advanced Maps on Apps.pptx
For More Information

 Download the latest Nokia SDK for Java
 http://developer.nokia.com

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

 Nokia Maps API
 http://developer.nokia.com/Maps




36   © Nokia 2012 Advanced Maps on Apps.pptx

More Related Content

Similar to Advanced Maps on Apps for Series 40

GIS Standards and Interoperability
GIS Standards and InteroperabilityGIS Standards and Interoperability
GIS Standards and Interoperability
Nasr Khashoggi
 
Going Mobile with HTML5
Going Mobile with HTML5Going Mobile with HTML5
Going Mobile with HTML5
John Reiser
 
Dublinked tech workshop_15_dec2011
Dublinked tech workshop_15_dec2011Dublinked tech workshop_15_dec2011
Dublinked tech workshop_15_dec2011
Dublinked .
 
Getting your Data Out There: An Introduction to Distributed GIS
Getting your Data Out There:An Introduction to Distributed GISGetting your Data Out There:An Introduction to Distributed GIS
Getting your Data Out There: An Introduction to Distributed GIS
John Reiser
 

Similar to Advanced Maps on Apps for Series 40 (20)

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
 
Be Location Intelligent with MapInfo Pro v2019
Be Location Intelligent with MapInfo Pro v2019Be Location Intelligent with MapInfo Pro v2019
Be Location Intelligent with MapInfo Pro v2019
 
LUMIA APP LAB #16: HERE APPLICATION LAUNCHERS
LUMIA APP LAB #16: HERE APPLICATION LAUNCHERSLUMIA APP LAB #16: HERE APPLICATION LAUNCHERS
LUMIA APP LAB #16: HERE APPLICATION LAUNCHERS
 
Knowledge graph layer for Telco portal, (Topic Maps 2008)
Knowledge graph layer for Telco portal, (Topic Maps 2008) Knowledge graph layer for Telco portal, (Topic Maps 2008)
Knowledge graph layer for Telco portal, (Topic Maps 2008)
 
GIS Standards and Interoperability
GIS Standards and InteroperabilityGIS Standards and Interoperability
GIS Standards and Interoperability
 
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
 
Going Mobile with HTML5
Going Mobile with HTML5Going Mobile with HTML5
Going Mobile with HTML5
 
Offline maps for mobile developers (Android/iOS)
Offline maps for mobile developers (Android/iOS)Offline maps for mobile developers (Android/iOS)
Offline maps for mobile developers (Android/iOS)
 
Oracle and Mobile, From Design to Device; The tools that make it happen - Use...
Oracle and Mobile, From Design to Device; The tools that make it happen - Use...Oracle and Mobile, From Design to Device; The tools that make it happen - Use...
Oracle and Mobile, From Design to Device; The tools that make it happen - Use...
 
AMIS UX Event 2014: Mobile ADF; From Design To Device; The Tools that make it...
AMIS UX Event 2014: Mobile ADF; From Design To Device; The Tools that make it...AMIS UX Event 2014: Mobile ADF; From Design To Device; The Tools that make it...
AMIS UX Event 2014: Mobile ADF; From Design To Device; The Tools that make it...
 
iMap 4.0 Effective Management of Spatial Information
iMap 4.0 Effective Management of Spatial InformationiMap 4.0 Effective Management of Spatial Information
iMap 4.0 Effective Management of Spatial Information
 
Publishing on ArcGIS Mobile
Publishing on ArcGIS MobilePublishing on ArcGIS Mobile
Publishing on ArcGIS Mobile
 
2013 Enterprise Track, Building GIS, Decision Support, and Location Intellige...
2013 Enterprise Track, Building GIS, Decision Support, and Location Intellige...2013 Enterprise Track, Building GIS, Decision Support, and Location Intellige...
2013 Enterprise Track, Building GIS, Decision Support, and Location Intellige...
 
AMIS OOW 2012 Review - Deel 4 ADF - Paco van der Linden
AMIS OOW 2012 Review - Deel 4 ADF - Paco van der LindenAMIS OOW 2012 Review - Deel 4 ADF - Paco van der Linden
AMIS OOW 2012 Review - Deel 4 ADF - Paco van der Linden
 
From Data to Maps to Docs: Turn Days into Minutes with Automated Integration
From Data to Maps to Docs: Turn Days into Minutes with Automated IntegrationFrom Data to Maps to Docs: Turn Days into Minutes with Automated Integration
From Data to Maps to Docs: Turn Days into Minutes with Automated Integration
 
Dublinked tech workshop_15_dec2011
Dublinked tech workshop_15_dec2011Dublinked tech workshop_15_dec2011
Dublinked tech workshop_15_dec2011
 
Mobile Multi-domain Search over Structured Web Data
Mobile Multi-domain Search over Structured Web DataMobile Multi-domain Search over Structured Web Data
Mobile Multi-domain Search over Structured Web Data
 
Getting your Data Out There: An Introduction to Distributed GIS
Getting your Data Out There:An Introduction to Distributed GISGetting your Data Out There:An Introduction to Distributed GIS
Getting your Data Out There: An Introduction to Distributed GIS
 
Android quick talk
Android quick talkAndroid quick talk
Android quick talk
 
Couchbase Mobile on Android
Couchbase Mobile on AndroidCouchbase Mobile on Android
Couchbase Mobile on Android
 

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
 
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
 
Lens app trasformare il telefono in una fotocamera
Lens app trasformare il telefono in una fotocameraLens app trasformare il telefono in una fotocamera
Lens app trasformare il telefono in una fotocamera
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
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...
 
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
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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, ...
 
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...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

Advanced Maps on Apps for Series 40

  • 1. Nokia Series 40 Application Development and Design with the Nokia Maps API for Java ME on Series 40 phones Jason Fox Technical Support Engineer Maps Platform 1 © Nokia 2012 Advanced Maps on Apps.pptx
  • 2. Agenda 1. Brief Overview of the Nokia Maps API for Java ME. 2. Where to store your Geographic data 3. Data Feeds (JSON + XML) 4. Parsing Data from a Web Service 5. KML 6. Overlays 2 © Nokia 2012 Advanced Maps on Apps.pptx
  • 3. A Brief Overview of the Nokia Maps API for Java ME 3 © Nokia 2012 Advanced Maps on Apps.pptx
  • 4. What is Nokia Maps API for Java ME? • API aimed at Series 40 Phones. Allows you to develop mobile applications based on Nokia Maps. • Façade Pattern - hides all the “plumbing” code - the low level connection calls, image manipulation etc. • Targets devices supporting MIDP 2.0 or higher. • Not currently part of the SDK • Single downloadable JAR around 150 kB. • Faster App development. Better App performance Full details at : http://www.developer.nokia.com/Develop/Maps/Maps_API_for_Java_ME/ 4 © Nokia 2012 Advanced Maps on Apps.pptx
  • 5. What Features does the API have? • Interactive Maps on Series 40 phones • Multiple map types • Multiple languages available • Markers, Images, Polygons, Polylines, Pan and Zoom. • Search, routing and POI information services. • Open to extension 5 © Nokia 2012 Advanced Maps on Apps.pptx
  • 6. What problems does the API solve? or “Why your S40 Map App should use the Nokia Maps API for Java ME” 6 © Nokia 2012 Advanced Maps on Apps.pptx
  • 7. What problems does the API solve? (1) • Series 40 Phones • Small Screen Size • Typical phone does not have onboard maps. • Nokia Maps are Mobile Optimised • Reduced clutter on screen • Large Fonts Readable on Small Display • Lower Colour Saturation • Pan and Zoom Pass control to the User to get Context on the Map • Map tiling and caching for low latency and reduced network traffic 7 © Nokia 2012 Advanced Maps on Apps.pptx
  • 8. What problems does the API solve? (2) Opportunities • Introduce geographic context to your information. • Displaying an interactive Map You have : • Geographical Information that you wish to show in context. You want: • A convenient front-end Presentation Layer for displaying your information. • MapDisplay to get the right Map on the screen • MapObjects to overlay this Map with your information • MapComponents to extend and interact with your information 8 © Nokia 2012 Advanced Maps on Apps.pptx
  • 9. What problems does the API solve? (3) Opportunities • The ability to enhance your application through accessing additional API services • Search • Places • Routing • Able to display complex data sets whilst reducing development time • Overlays • KML Support 9 © Nokia 2012 Advanced Maps on Apps.pptx
  • 10. Storing, Obtaining and Displaying Data for your Map-based Application 10 © Nokia 2012 Advanced Maps on Apps.pptx
  • 11. The Generic Use Case for a Map Based Application A typical Map-based application will: • Obtain application data from somewhere (e.g. a Web service) • Display a map with associated Map Markers • When the user clicks on a map marker the app will a display more information associated with that location on a separate screen. Why use a map-based interface? • Familiar Paradigm • Intuitive • Easy to use 11 © Nokia 2012 Advanced Maps on Apps.pptx
  • 12. What design does this indicate? (1) In the generic use case: • the data could come from anywhere • the data could be in any format. Hence none of this is wired up automatically. You have to plug it in yourself. But there is one constant across the data for every map based application: “Every datum point will consist of both geographic and non geographic information” 12 © Nokia 2012 Advanced Maps on Apps.pptx
  • 13. What design does this indicate? (2) From the geographic information: • Create a GeoCoordinate from the longitude/latitude associated with each datum point. • Add a marker to the map to highlight the location of the GeoCoordinate using either a MapStandardMarker or a MapMarker From the non-geographic information: • Use a Hashtable to associate the MapMarker with the non-geographic information. 13 © Nokia 2012 Advanced Maps on Apps.pptx
  • 14. What design does this indicate? (3) Whenever interaction occurs, the app needs to : • Check if a marker has been “clicked” • Retrieve the associated non-geographic information from the Hashtable • Do any necessary additional operations 14 © Nokia 2012 Advanced Maps on Apps.pptx
  • 15. Where does the app get its data from? Data can be conveniently split into two types: Static Data • Fixed, unchanging • Can be bundled with the App • No need for a data connection Dynamic Data • Volatile, unreliable • Keeps the App relevant • Needs to be requested from a web service Avoid the overhead of dynamic data wherever possible, but you will need to go online anyway since the maps require a data connection 15 © Nokia 2012 Advanced Maps on Apps.pptx
  • 16. How dynamic is your dynamic data? Completely Static Data e.g. Quiz App - “Capitals of the World” • Bundle data with app Long Period Data e.g. “Festival 2012” • Bundle data with app, update app version next year. Short Period Data e.g. “Tourist Guide for …” • Read once then store and retrieve from device Daily Data e.g. “Deals for Today …” • Read online summary once on start up. • May need to request more details later Real Time Updates e.g. “Social Media” • Poll online for limited data summaries 16 © Nokia 2012 Advanced Maps on Apps.pptx
  • 17. Data Feeds and Formats 17 © Nokia 2012 Advanced Maps on Apps.pptx
  • 18. Data Feeds There are currently two popular alternative data formats for transmitting structured data over a network connection. Both are language independent and text based. JSON http://json.org • Syntax is derived from JavaScript • Structure is defined through the use of brackets [{]} • Objects are mapped as key-value pairs separated by a colon : XML http://www.w3.org/TR/REC-xml • Syntax is defined by the World Wide Web Consortium • Structure consists of nesting elements with matching start and end tags. • Objects are defined as the content between the tags and any attributes (key-value pairs) associated to the element. 18 © Nokia 2012 Advanced Maps on Apps.pptx
  • 19. JSON Data Format Data received will be a consistent format which may contain • key-value pairs - “name” • arrays of elements - “coordinates” • complex types - “geo” 19 © Nokia 2012 Advanced Maps on Apps.pptx
  • 20. XML Data Format • Simple key-value pairs are held within a single pair of tags - <name> • Complex elements may have attributes - <geo> • Arrays may be build up from multiple elements with the same name. Conventionally array elements are given plural names - for example, the <results> element contains a series of <result> elements 20 © Nokia 2012 Advanced Maps on Apps.pptx
  • 21. Parsing and Displaying Data from a Web Service or “Getting your map data on screen the hard way” 21 © Nokia 2012 Advanced Maps on Apps.pptx
  • 22. Parsing JSON Data No standard JSON parser library available. Need to write your own. Hint: An Example JSON parser can be found bundled with the API examples • Parser will typically place all JSON objects into a Hashtable , need to extract the entries you require by either: • casting directly (for simple types) e.g. key-value pairs • building up more complex element step by step Still have to know the data structure, names of entries and so on. … and then create your MapMarkers, and data associations etc. 22 © Nokia 2012 Advanced Maps on Apps.pptx
  • 23. Parsing XML Data A Standard SAX parser implementation of JSR 172 comes as part of the Java ME Web Services Optional package. It will fire events as the XML is processed. Override these events to process your data. • startElement() fired whenever the parser encounters an opening <tag> • characters() occurs for all text within the <tag>…</tag> • endElement() fired whenever the parser encounters a closing </tag> Still have to know the data structure, element qnames, attributes and so on … and finally create your MapMarkers, and data associations etc… 23 © Nokia 2012 Advanced Maps on Apps.pptx
  • 24. An Ideal Data Format Wouldn’t it be more convenient if there existed a data format that: • Used a standard on-board parsing library like XML? • Had a standardised data structure so that I wouldn’t need to modify my parsing code for each implementation? • Created and styled MapObjects directly from the data feed? • Automatically associated each MapObject with its non-geographic data? • Worked just as well on the web as on the device? This is KML 24 © Nokia 2012 Advanced Maps on Apps.pptx
  • 25. What is KML? KML http://www.opengeospatial.org/standards/kml/ Keyhole Markup Language (KML) is an standardized XML notation for geographic applications. KML is able to: • Specify icons and labels to identify locations. • Specify additional information (e.g. address, phone number) associated with a specific location. • Define other elements such as polygons and polylines and attach them to the map. • Define styles to specify feature appearance. • Write HTML descriptions of features, including hyperlinks and embedded images • Use folders for hierarchical grouping of features Most importantly a KML Parser already exists within the Maps API for Java ME. No need to write your own parser. No need to write custom code to display and interact with your data. 25 © Nokia 2012 Advanced Maps on Apps.pptx
  • 26. KML Data Format • Exactly the same structure as any XML document • KML is a subset of XML • The names of each element in the KML feed are strictly defined • the longitude/latitude must be a value held in a <coordinates> tag. • for a point of interest this is enclosed in a <Point> tag. • Every item on the map is defined inside a <Placemark> tag. 26 © Nokia 2012 Advanced Maps on Apps.pptx
  • 27. The Relationship between MapObjects and KML Elements Many MapObjects have a direct equivalent in KML Nokia Maps API KML KML KML for Java ME Feature Geometry Style MapStandard <Placemark> <Point> Marker (with <styleUrl>) MapMarker <Placemark> <Point> <IconStyle> MapPolyline <Placemark> <LineString> <LineStyle> MapPolygon <Placemark> <Polygon> <PolyStyle> MapContainer <Folder> or <Document> For parsed elements such as <description>, <phoneNumber> and <extendedData> where no direct equivalent object exists, the API will give access to the parsed KML data in the Feature interface. 27 © Nokia 2012 Advanced Maps on Apps.pptx
  • 28. Parsing and Displaying KML Data or “Getting your map data on screen the easy way” 28 © Nokia 2012 Advanced Maps on Apps.pptx
  • 29. Parsing and Displaying a KML File (1) 1) Implement a KMLParserListener and a KMLFactoryListener, create a KMLManager and call parseKML()- This will create a KML Document 2) Handle Success and Failure. If successful, convert the KML Document into a KMLResultSet by calling KMLFactory.createMLResultSet()passing in the received KML Document. 29 © Nokia 2012 Advanced Maps on Apps.pptx
  • 30. Parsing and Displaying a KML File (2) 3) Handle Success and Failure. If successful, the KMLResultSet.getContainer() will hold a MapContainer which has all your map data as MapObjects. You can add it to the MapDisplay in the usual manner, and zoom as necessary 4) Add Interactive KMLMapComponent as necessary. The KMLResultSet.getKMLMapComponent() will highlight styled <Placemark> elements when they are at the center of the screen, the KMLMapComponent needs to be added to the MapDisplay to do this. 30 © Nokia 2012 Advanced Maps on Apps.pptx
  • 31. Interacting with KML File Data 5) To receive onFocusChanged()events and interact with the <Placemark> elements, you will need to implement a KMLEventListener 6) Attach the KMLEventListener to the KMLMapComponent of your result set. This obtained from KMLResultSet.getKMLMapComponent() 7) An onFocusChanged()event is fired whenever a <Placemark> is moved onto or away from the center of the MapDisplay. If you want to interact with other <Placemark> elements, you will have to iterate through KMLResultSet.getFeatures(). 31 © Nokia 2012 Advanced Maps on Apps.pptx
  • 32. Displaying Complex Datasets An Introduction to Overlays 32 © Nokia 2012 Advanced Maps on Apps.pptx
  • 33. How Map Providers and Overlays Work • For the base map providers, the globe is divided into individual map tiles. These are retrieved online from Nokia’s map tile service. Base Map Tiles • At minimum zoom, the world is contained in a single 128x128 pixel tile. • At the next zoom level up, the world is 2 tiles wide and 2 tiles high. Then 4x4, 8x8, 16x16 etc. + • Each zoom level splits the tiles in two, doubling the number of tiles across the width and height • Each Map is based on the Normalized Mercator projection. Overlay Tiles • Overlays work in the same fashion - using your own map tile server complex visual data can be displayed at = different zoom levels. • One tile at minimum zoom, then 2x2, 4x4 and so on. • Must be based on the Normalized Mercator projection. Result • Use PNG tiles to support transparency, so underlying map can be seen beneath your data. 33 © Nokia 2012 Advanced Maps on Apps.pptx
  • 34. Implementing a MapURLProvider (1) 1) To create your own overlay provider, create a subclass of MapURLProvider 2) Implement the necessary abstract methods. 3) Then add the overlay to the MapDisplay 4) Don’t forget Overlay attribution if necessary. 34 © Nokia 2012 Advanced Maps on Apps.pptx
  • 35. Implementing MapURLProvider (2) Necessary Overrides • String getTileUrl() • Used to create the URL in order to download an overlay map tile. • Map tile service requests are typically of the format: http://map_tiler_url/x_tile/y_tile/zoom_level/format.png • boolean isTileSupported() • Decides whether to make an http request to download the tile. • The API will throw onMapUpdateError()if a tile cannot be downloaded. Optional Overrides • Image decode(byte[] data) • May be used for image post processing (e.g. scaling up images) • String getMimeType() • Default is PNG - override if Map tile service is not returning PNG images. 35 © Nokia 2012 Advanced Maps on Apps.pptx
  • 36. For More Information Download the latest Nokia SDK for Java http://developer.nokia.com Consult the Nokia Developer Library http://library.developer.nokia.com Nokia Maps API http://developer.nokia.com/Maps 36 © Nokia 2012 Advanced Maps on Apps.pptx

Editor's Notes

  1. Which data feed to use?
  2. http://www.developer.nokia.com/info/sw.nokia.com/id/6bdf62e2-c739-4c29-bd9f-ddf8455f563e/JavaME.htmlFaçade Pattern - hides all the “plumbing” code - the low level connection calls, image manipulation etc. leaving a simple and consistent interface so you don’t need to reinvent the wheel.
  3. Does all the hard bits so you don’t have to bother.
  4. Typical Screen Size 320 x 240 pixels, 2.6 inchesAppropriate Map
  5. Scale Bar, tool tip animator
  6. Typcial Multi-tier architecture.MIDP – Good user experience but ….. …..Network connection setup is slow.Data rates are slow.The processor is slow.Memory is scarce.Because of these constraints, MIDP client applications should be designed to be as small as possible. Do as much as possible server side.
  7. The “What” and the “Where”
  8. The associoation is probably better implemented as a Map Component.
  9. Note that the SAMEDATA can be easily displayed in a multitude of ways.UX design course stated that.GIVE THEM THE OPTION
  10. Static dataHow dynamic is your dynamic data?For an application to remain relevant you need to be able t1) On device:2)How dynamic is your dynamic data?Since maps are not offline will require a web connection anyway
  11. in-app purchasing
  12. JSON used with WEBsites e.g. JavaScript will typically consume JSON feeds – use for cross platform.XML
  13. 40.0191219,-105.2746654 - Where does this place me? I’m apparently on 16th Street in Boulder, Colorado, USAArbitrary names for elements.
  14. The title of this slide is slightly misleading as the Display bit has already been covered previously (mainly basic maps webinar)Why do hard first - The discussion for the next couple of slides serves to show the purpose fulfilled by an on-board KML parser.
  15. Parser will read ALL the data first and then start processing.DEVELOPER will need to know data structure Will vary app to app.e.g. that a geo contains a coordinates which is an array.Also Need to know the keys of all the items – re-implement for each app.
  16. SAX not DOM – reduces memory overhead, but can’t jump around the fileNeed to read the whole tag – tag before processing. Could use this to deserialize data
  17. Benefits of KML – everything XML has plus well defined Geo-based structure. In common use. E.g. Earth Viewers.See benefits of Mobile Optimized on screen –compare web and mobile screens – mobile less cluttered and clearer.Ensure Icons are a minimal size 9x9 pixels.Tooltip here is non-standard – give minimal info prior to details. Avoid key press. Man City – nokia blue will be default.
  18. Same as the XML Example –just that the tag names have changed. Well defined NAMESPACE We are still in Boulder Colorado lat/long alt
  19. Use features to associate non-geographic data. Extended Data is a Map ObjectUse Geometries to define the Where on the screenUse Styles to alter the look-and- feel (StyleMap can do highlighting). Styles are MORE EFFICIENT when loading data than Inline Styles,.
  20. parseKML also handles URL connection.Document, Feature,PlaceMark– every class within the kml package have same name as associated KML element (Means there are two POINT classes.)parser.parse(getClass().getResourceAsStream(&quot;/premiership.kml&quot;), this);  obtain data from bundled resource.createResultSet can also Scale (if necessary) – if you have control do this server side, avoid overhead.
  21. The MapContainer from the ResultSet separates the View of the data on the MapDisplay from the underlining Data ModelAfter 3) you will get markers on the map. They won’t do anything though When d
  22. Why bother? – could use alternate maps – e.g. small text “Standard Web” versions.Easter Egg maps – e.g. Low Glare “Night Mode”. Recommendation – have a fallback.
  23. e.g. Weather, traffic sales data.
  24. MapTiler.org has a useful tool which explains various url addressing systems.Niothing wrong with providing small tiles and expanding them to fit Keep data overhead a munimumConsider adding a MApComponent which overrides paint to display small tileo