SlideShare a Scribd company logo
Nokia Series 40

Application Development with
Nokia Maps and Location APIs
for Series 40


Jason Fox
Technical Support Engineer
Maps Platform
1   © Nokia 2012 Intro to Maps on Apps.pptx
Agenda
1. Introduction to Nokia Maps API for
   Java ME
2. Getting Started - Prerequisites
3. Basic Mapping Concepts
4. An Introduction to the Search and
   Routing Services
5. An Introduction to positioning
    (JSR-179)

2   © Nokia 2012 Intro to Maps on Apps.pptx
Nokia Maps API for Java ME




3   © Nokia 2012 Intro to 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 Intro to Maps on Apps.pptx
Why use Nokia Maps API for Java ME?
• Multiple map types optimised for mobile
  displays

• Low latency and reduced network traffic
  compared with static map image solutions.

• “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.

• Map Components are open to extension -
  ability to customise and override standard
  API functionality.

• Advanced Features as standard, such as KML parsing and the addition
  of custom overlays
 5   © Nokia 2012 Intro to Maps on Apps.pptx
Comparison of Nokia Maps for Java
ME vs. Static Map Image Solutions
Static Map (e.g. RESTful Map API)
•        one single http request per map ->one
          single image returned in response
•        new request for each alteration.

Maps for Java ME
•        multiple http requests for individual map tiles.
•        Map tiles are cached.
•        Map tiles stitched together and objects
         added to display result on screen
•        Additional requests only made if necessary.


        Result
        • Reduced latency and lowered network traffic though built-in intelligent
          map rendering, caching and tiling = Better for Mobile.
    6      © Nokia 2012 Intro to Maps on Apps.pptx
Prerequisites




7   © Nokia 2012 Intro to Maps on Apps.pptx
Prerequisites
1. Install a Java Runtime Environment 6
     http://www.java.com/en/download/index.jsp

2. Install an IDE (e.g. NetBeans)
     Netbeans.org

3. Install a Nokia SDK for Java (free)
     http://www.developer.nokia.com/Develop/Java/Tools/




 8    © Nokia 2012 Intro to Maps on Apps.pptx
Prerequisites
                                                     1.
4. Configure Nokia SDK in NetBeans

 2.




                                                3.
 9    © Nokia 2012 Intro to Maps on Apps.pptx
Prerequisites
5. Download the binary Jar
      http://www.developer.nokia.com/Develop/Maps/Maps_API_for_Java_ME/Getting_started/




 10     © Nokia 2012 Intro to Maps on Apps.pptx
Prerequisites
6. Register as a developer free at www.developer.nokia.com




 11   © Nokia 2012 Intro to Maps on Apps.pptx
Prerequisites
7. Obtain a free set of authentication credentials (App Id
   and Token) from:             https://api.developer.nokia.com/ovi-
      api/ui/registration
      − A unique App ID and Token, are required for each application


8. After creating a new NetBeans project, You must add a
   reference to the Nokia Maps API binary jar itself -
   Maps_API.jar. This reference is added under the
   ”Resources” folder in theNetBeans project.




 12    © Nokia 2012 Intro to Maps on Apps.pptx
Basic Mapping Concepts
• The Minimal Map

• An Introduction to Map Types

• Map Languages

• Markers

• Polylines and Polygons

• Interaction




13   © Nokia 2012 Intro to Maps on Apps.pptx
The Minimal Map
A Pannable Zoomable Map in five lines of code
      1. Set credentials in the ApplicationContext

      2. Create a MapCanvas

      3. Set it as the current Display




 14   © Nokia 2012 Intro to Maps on Apps.pptx
Map Types
Pick the right map type for your app




 15   © Nokia 2012 Intro to Maps on Apps.pptx
Map Types – Simple Method

The Standard Map Schemes




The Code




16   © Nokia 2012 Intro to Maps on Apps.pptx
Map Types – Advanced Method
1)    Implement a MapSchemeListener and call getAvailableMaps()




2)    Handle Success and Failure




3)    Set the BaseMapType from MapProviders received




 17    © Nokia 2012 Intro to Maps on Apps.pptx
Map Languages

• Currently eight map Languages available
      Arabic, Chinese, German, English,
      French, Italian, Russian and Spanish

• Just set the DefaultLanguage in the
  ApplicationContext




• By default Maps are displayed in English


18   © Nokia 2012 Intro to Maps on Apps.pptx
Map Markers
Markers highlight points of interest at a specified location
on the map - two types exist:
• MapStandardMarker
      • Various Geometric Shapes plus Balloon
      • Easy to add text, change color
                                      (and opacity)
• MapMarker
      • Used to add graphical icons.
      • Need to define an anchor point.

•        Use the MapFactory to created instances of
         MapStandardMarkers and MapMarkers


•        Default marker is a ‘Nokia Blue’ Balloon

    19     © Nokia 2012 Intro to Maps on Apps.pptx
Polylines and Polygons
• A MapPolyline is a series of connected points




• A MapPolygon is the area within a closed loop of points




• Every instance of a MapPolygon or MapPolyline is
  created using the MapFactory

• Both objects have an implicit GeoBoundingBox.



 20   © Nokia 2012 Intro to Maps on Apps.pptx
MapCanvas MapDisplay MapObject
• MapCanvas holds a MapFactory
  and a MapDisplay

• Use the MapFactory to create
  MapObjects

• Can also use MapFactory to create
  a MapDisplay directly e.g. for
  automatic caching of Static Maps

• The MapDisplay contains MapObjects but is also a
  MapObject itself.

• MapObjects may be also be contained within a MapContainer


21   © Nokia 2012 Intro to Maps on Apps.pptx
Map Events



     • Create a MapComponent to interact with your MapDisplay


     • Add an EventListener to your MapComponent to receive notifications
       of screen interactions and key presses




22    © Nokia 2012 Intro to Maps on Apps.pptx
An Introduction to Location-Based Services

     • Search (Geocoding and Reverse Geocoding)

     • Places Search

     • Routing

     • Sharing




23   © Nokia 2012 Intro to Maps on Apps.pptx
Geocoding Search
•    Finds a location on the Map from a given
     Address

•    Search can be either synchronous or
     asynchronous.

•    Asynchronous search is preferred.


1. Implement a GeoCodeRequestListener


2. Create a GeoCodeRequest



3. Handle Success or Failure




24    © Nokia 2012 Intro to Maps on Apps.pptx
Reverse Geocoding Search
     •   Finds the Address for a given geographic location.
     •   Search can be either synchronous or asynchronous.
     •   Asynchronous search is preferred.

     1. Implement a ReverseGeocodeRequestListener


     2. Create a ReverseGeoCodeRequest




     3. Handle Success or Failure




25       © Nokia 2012 Intro to Maps on Apps.pptx
Places Search
• Flexible Local Search
             •      General Text Search (e.g. “Pizza”)
             •      Category Search (e.g. restaurant)
             •      Combined Search (e.g. “Italian” + restaurant)




• Drill down to get more details
     •      Contact Details
     •      Opening Times
     •      Description and Reviews
     •      Images etc.


26       © Nokia 2012 Intro to Maps on Apps.pptx
Places Search
     1. Implement a PlaceSearchRequestListener


     2. Create a PlaceSearchRequest




     3. Handle Success or Failure



     4. More details can be obtained by interrogating the Result




27     © Nokia 2012 Intro to Maps on Apps.pptx
Routing Service
     • Routing Service consists of creating a route between two or
       more Waypoints.

     • Responses from the Routing service can take time. Make
       your RouteRequests asynchronously.

     1. Implement a RouteListener

     2. Create a RouteRequest




     3. Handle Success or Failure




28    © Nokia 2012 Intro to Maps on Apps.pptx
Routing Service
 • The preferred route calculation can be optimized by altering the
   parameters of the RoutingMode

     •       Routing Type – default is RoutingType.Shortest




     •     Mode of Transport – default is TransportMode.CAR




     •     Additional Restrictions – None are selected by default




29   © Nokia 2012 Intro to Maps on Apps.pptx
Sharing Manager
      • Creates short encrypted URLs for the RESTful Maps API


      • Send URL as an SMS for a client to receive a static map.

      • Service forwards to maps.nokia.com or m.maps.nokia.com on
        capable browsers




30   © Nokia 2012 Intro to Maps on Apps.pptx
Positioning

• Separate Optional Package for Positioning (JSR-179)

• Frequently combined with the Nokia Maps API for Java ME, though not
  part of the API itself

• Two location methods maybe available
  • Cell ID positioning
  • GPS




31   © Nokia 2012 Intro to Maps on Apps.pptx
Cell-ID Location
• A MIDlet can obtain an approximate position using the Cell-ID location
  method.

• The method consists of passing the ID of the cell the device is currently
  connected to, on to a look-up service. The service will then return the
  well-known position of the given cell-ID.

• This Cell ID location provides a method of positioning mobile devices
  which do not contain a GPS unit.


Note: the degree of uncertainty can vary of a few meters to hundreds of
kilometers, depending upon the infrastructure of the local network and the
data available to the look-up service for that region



 32   © Nokia 2012 Intro to Maps on Apps.pptx
Cell-ID Example

1) Create a Cell-ID LocationProvider using LocationUtils


      Note: The second parameter of getLocationProvider() is currently
      always null. This leaves the library open for future extension

2) Make a call to getLocation() and process the result




The attributes of the QualifiedCoordinate class map directly onto the
GeoCoordinate class.

Set up a loop and poll to obtain location updates.

 33      © Nokia 2012 Intro to Maps on Apps.pptx
LocationUtil
• The preferred Location method(s) can
  be any combination of the methods
  defined in JSR-179:

Useful Combinations
• Offline Cell ID

• Standalone GPS

• Assisted GPS

• Online Cell ID an/or WLAN


34    © Nokia 2012 Intro to Maps on Apps.pptx
GPS Example

1. Create a GPS LocationProvider




2. Set the provider to start polling

3. Retrieve and process the result




 35    © Nokia 2012 Intro to 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 Intro to Maps on Apps.pptx

More Related Content

PDF
Advanced Maps on Apps for Series 40
PDF
IBM Mobile Foundation POT - Part 2 introduction to application development wi...
PPTX
The Blackberry Opportunity (RIM) 160612
PDF
Optimise Nokia Maps applications for Nokia Asha Touch phones
PDF
Event-driven map components for Series 40 apps
PPTX
Healthcare apps for Nokia X and Nokia Asha
PDF
Nokia Asha from idea to app - Imaging
PDF
Lumia App Labs: Lumia SensorCore SDK beta
Advanced Maps on Apps for Series 40
IBM Mobile Foundation POT - Part 2 introduction to application development wi...
The Blackberry Opportunity (RIM) 160612
Optimise Nokia Maps applications for Nokia Asha Touch phones
Event-driven map components for Series 40 apps
Healthcare apps for Nokia X and Nokia Asha
Nokia Asha from idea to app - Imaging
Lumia App Labs: Lumia SensorCore SDK beta

Similar to Intro to apps with maps for series 40 (20)

PDF
Mobile Maps On Labs
PPTX
Mobile Manifest - Nokia Maps
PPTX
Google Location Services
PDF
ANDROID MAPPING APPLICATION
PDF
Maps API on_mobile_dev_festbangkok
PPTX
Location and API Maps in Windows Phone 8
PDF
LUMIA APP LABS: HERE MAPS AND LOCATION APIS FOR WINDOWS PHONE
PDF
LUMIA APP LABS: WINDOWS PHONE 8 FOR NOKIA DEVELOPERS
PDF
Building Mobile Cross-Platform Geospatial Apps, Nick Landry
PDF
HERE Maps for the Nokia X platform
PDF
Hello GoogleMaps!
PDF
LUMIA APP LAB #16: HERE APPLICATION LAUNCHERS
PPTX
Porting Hotels.com to Nokia X
DOCX
Location Based Services Android Google Maps API with Examples
PPTX
Maps in android
KEY
Developing iOS Map Applications with C#
PDF
C0422019024
PPT
5. Mohit Agrawal Nokia
PPT
Synapseindia android application development tutorial
PPT
Synapseindia android apps development tutorial
Mobile Maps On Labs
Mobile Manifest - Nokia Maps
Google Location Services
ANDROID MAPPING APPLICATION
Maps API on_mobile_dev_festbangkok
Location and API Maps in Windows Phone 8
LUMIA APP LABS: HERE MAPS AND LOCATION APIS FOR WINDOWS PHONE
LUMIA APP LABS: WINDOWS PHONE 8 FOR NOKIA DEVELOPERS
Building Mobile Cross-Platform Geospatial Apps, Nick Landry
HERE Maps for the Nokia X platform
Hello GoogleMaps!
LUMIA APP LAB #16: HERE APPLICATION LAUNCHERS
Porting Hotels.com to Nokia X
Location Based Services Android Google Maps API with Examples
Maps in android
Developing iOS Map Applications with C#
C0422019024
5. Mohit Agrawal Nokia
Synapseindia android application development tutorial
Synapseindia android apps development tutorial
Ad

More from Microsoft Mobile Developer (20)

PDF
Intro to Nokia X software platform 2.0 and tools
PDF
Push notifications on Nokia X
PDF
DIY Nokia Asha app usability studies
PDF
Lessons learned from Nokia X UI reviews
PDF
Location based services for Nokia X and Nokia Asha using Geo2tag
PDF
Nokia In-App Payment - UX considerations
PDF
Introduction to Nokia Asha SDK 1.2 (beta)
PDF
UX considerations when porting to Nokia X
PDF
Kids' games and educational app design
PDF
Nokia X: opportunities for developers
PDF
Lumia App Labs: Nokia Imaging SDK 1.1
PDF
Intro to Nokia X software platform and tools
PDF
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations
PDF
Windows Phone 8 speech: parliamo con la nostra app
PDF
La pubblicazione di un'applicazione sullo store
PDF
Il pattern mvvm come strutturare al meglio il vostro progetto
PDF
Lens app trasformare il telefono in una fotocamera
PDF
NFC, Bluetooth e comunicazione tra app
PDF
Nokia Asha webinar: Developing health-care applications for Nokia Asha phones
PDF
Connettersi al Cloud Azure Mobile Services
Intro to Nokia X software platform 2.0 and tools
Push notifications on Nokia X
DIY Nokia Asha app usability studies
Lessons learned from Nokia X UI reviews
Location based services for Nokia X and Nokia Asha using Geo2tag
Nokia In-App Payment - UX considerations
Introduction to Nokia Asha SDK 1.2 (beta)
UX considerations when porting to Nokia X
Kids' games and educational app design
Nokia X: opportunities for developers
Lumia App Labs: Nokia Imaging SDK 1.1
Intro to Nokia X software platform and tools
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Windows Phone 8 speech: parliamo con la nostra app
La pubblicazione di un'applicazione sullo store
Il pattern mvvm come strutturare al meglio il vostro progetto
Lens app trasformare il telefono in una fotocamera
NFC, Bluetooth e comunicazione tra app
Nokia Asha webinar: Developing health-care applications for Nokia Asha phones
Connettersi al Cloud Azure Mobile Services
Ad

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Spectroscopy.pptx food analysis technology
PDF
Machine learning based COVID-19 study performance prediction
PDF
Approach and Philosophy of On baking technology
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Encapsulation_ Review paper, used for researhc scholars
Diabetes mellitus diagnosis method based random forest with bat algorithm
Spectroscopy.pptx food analysis technology
Machine learning based COVID-19 study performance prediction
Approach and Philosophy of On baking technology
sap open course for s4hana steps from ECC to s4
Digital-Transformation-Roadmap-for-Companies.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Big Data Technologies - Introduction.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
MYSQL Presentation for SQL database connectivity
20250228 LYD VKU AI Blended-Learning.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Building Integrated photovoltaic BIPV_UPV.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx

Intro to apps with maps for series 40

  • 1. Nokia Series 40 Application Development with Nokia Maps and Location APIs for Series 40 Jason Fox Technical Support Engineer Maps Platform 1 © Nokia 2012 Intro to Maps on Apps.pptx
  • 2. Agenda 1. Introduction to Nokia Maps API for Java ME 2. Getting Started - Prerequisites 3. Basic Mapping Concepts 4. An Introduction to the Search and Routing Services 5. An Introduction to positioning (JSR-179) 2 © Nokia 2012 Intro to Maps on Apps.pptx
  • 3. Nokia Maps API for Java ME 3 © Nokia 2012 Intro to 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 Intro to Maps on Apps.pptx
  • 5. Why use Nokia Maps API for Java ME? • Multiple map types optimised for mobile displays • Low latency and reduced network traffic compared with static map image solutions. • “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. • Map Components are open to extension - ability to customise and override standard API functionality. • Advanced Features as standard, such as KML parsing and the addition of custom overlays 5 © Nokia 2012 Intro to Maps on Apps.pptx
  • 6. Comparison of Nokia Maps for Java ME vs. Static Map Image Solutions Static Map (e.g. RESTful Map API) • one single http request per map ->one single image returned in response • new request for each alteration. Maps for Java ME • multiple http requests for individual map tiles. • Map tiles are cached. • Map tiles stitched together and objects added to display result on screen • Additional requests only made if necessary. Result • Reduced latency and lowered network traffic though built-in intelligent map rendering, caching and tiling = Better for Mobile. 6 © Nokia 2012 Intro to Maps on Apps.pptx
  • 7. Prerequisites 7 © Nokia 2012 Intro to Maps on Apps.pptx
  • 8. Prerequisites 1. Install a Java Runtime Environment 6 http://www.java.com/en/download/index.jsp 2. Install an IDE (e.g. NetBeans) Netbeans.org 3. Install a Nokia SDK for Java (free) http://www.developer.nokia.com/Develop/Java/Tools/ 8 © Nokia 2012 Intro to Maps on Apps.pptx
  • 9. Prerequisites 1. 4. Configure Nokia SDK in NetBeans 2. 3. 9 © Nokia 2012 Intro to Maps on Apps.pptx
  • 10. Prerequisites 5. Download the binary Jar http://www.developer.nokia.com/Develop/Maps/Maps_API_for_Java_ME/Getting_started/ 10 © Nokia 2012 Intro to Maps on Apps.pptx
  • 11. Prerequisites 6. Register as a developer free at www.developer.nokia.com 11 © Nokia 2012 Intro to Maps on Apps.pptx
  • 12. Prerequisites 7. Obtain a free set of authentication credentials (App Id and Token) from: https://api.developer.nokia.com/ovi- api/ui/registration − A unique App ID and Token, are required for each application 8. After creating a new NetBeans project, You must add a reference to the Nokia Maps API binary jar itself - Maps_API.jar. This reference is added under the ”Resources” folder in theNetBeans project. 12 © Nokia 2012 Intro to Maps on Apps.pptx
  • 13. Basic Mapping Concepts • The Minimal Map • An Introduction to Map Types • Map Languages • Markers • Polylines and Polygons • Interaction 13 © Nokia 2012 Intro to Maps on Apps.pptx
  • 14. The Minimal Map A Pannable Zoomable Map in five lines of code 1. Set credentials in the ApplicationContext 2. Create a MapCanvas 3. Set it as the current Display 14 © Nokia 2012 Intro to Maps on Apps.pptx
  • 15. Map Types Pick the right map type for your app 15 © Nokia 2012 Intro to Maps on Apps.pptx
  • 16. Map Types – Simple Method The Standard Map Schemes The Code 16 © Nokia 2012 Intro to Maps on Apps.pptx
  • 17. Map Types – Advanced Method 1) Implement a MapSchemeListener and call getAvailableMaps() 2) Handle Success and Failure 3) Set the BaseMapType from MapProviders received 17 © Nokia 2012 Intro to Maps on Apps.pptx
  • 18. Map Languages • Currently eight map Languages available Arabic, Chinese, German, English, French, Italian, Russian and Spanish • Just set the DefaultLanguage in the ApplicationContext • By default Maps are displayed in English 18 © Nokia 2012 Intro to Maps on Apps.pptx
  • 19. Map Markers Markers highlight points of interest at a specified location on the map - two types exist: • MapStandardMarker • Various Geometric Shapes plus Balloon • Easy to add text, change color (and opacity) • MapMarker • Used to add graphical icons. • Need to define an anchor point. • Use the MapFactory to created instances of MapStandardMarkers and MapMarkers • Default marker is a ‘Nokia Blue’ Balloon 19 © Nokia 2012 Intro to Maps on Apps.pptx
  • 20. Polylines and Polygons • A MapPolyline is a series of connected points • A MapPolygon is the area within a closed loop of points • Every instance of a MapPolygon or MapPolyline is created using the MapFactory • Both objects have an implicit GeoBoundingBox. 20 © Nokia 2012 Intro to Maps on Apps.pptx
  • 21. MapCanvas MapDisplay MapObject • MapCanvas holds a MapFactory and a MapDisplay • Use the MapFactory to create MapObjects • Can also use MapFactory to create a MapDisplay directly e.g. for automatic caching of Static Maps • The MapDisplay contains MapObjects but is also a MapObject itself. • MapObjects may be also be contained within a MapContainer 21 © Nokia 2012 Intro to Maps on Apps.pptx
  • 22. Map Events • Create a MapComponent to interact with your MapDisplay • Add an EventListener to your MapComponent to receive notifications of screen interactions and key presses 22 © Nokia 2012 Intro to Maps on Apps.pptx
  • 23. An Introduction to Location-Based Services • Search (Geocoding and Reverse Geocoding) • Places Search • Routing • Sharing 23 © Nokia 2012 Intro to Maps on Apps.pptx
  • 24. Geocoding Search • Finds a location on the Map from a given Address • Search can be either synchronous or asynchronous. • Asynchronous search is preferred. 1. Implement a GeoCodeRequestListener 2. Create a GeoCodeRequest 3. Handle Success or Failure 24 © Nokia 2012 Intro to Maps on Apps.pptx
  • 25. Reverse Geocoding Search • Finds the Address for a given geographic location. • Search can be either synchronous or asynchronous. • Asynchronous search is preferred. 1. Implement a ReverseGeocodeRequestListener 2. Create a ReverseGeoCodeRequest 3. Handle Success or Failure 25 © Nokia 2012 Intro to Maps on Apps.pptx
  • 26. Places Search • Flexible Local Search • General Text Search (e.g. “Pizza”) • Category Search (e.g. restaurant) • Combined Search (e.g. “Italian” + restaurant) • Drill down to get more details • Contact Details • Opening Times • Description and Reviews • Images etc. 26 © Nokia 2012 Intro to Maps on Apps.pptx
  • 27. Places Search 1. Implement a PlaceSearchRequestListener 2. Create a PlaceSearchRequest 3. Handle Success or Failure 4. More details can be obtained by interrogating the Result 27 © Nokia 2012 Intro to Maps on Apps.pptx
  • 28. Routing Service • Routing Service consists of creating a route between two or more Waypoints. • Responses from the Routing service can take time. Make your RouteRequests asynchronously. 1. Implement a RouteListener 2. Create a RouteRequest 3. Handle Success or Failure 28 © Nokia 2012 Intro to Maps on Apps.pptx
  • 29. Routing Service • The preferred route calculation can be optimized by altering the parameters of the RoutingMode • Routing Type – default is RoutingType.Shortest • Mode of Transport – default is TransportMode.CAR • Additional Restrictions – None are selected by default 29 © Nokia 2012 Intro to Maps on Apps.pptx
  • 30. Sharing Manager • Creates short encrypted URLs for the RESTful Maps API • Send URL as an SMS for a client to receive a static map. • Service forwards to maps.nokia.com or m.maps.nokia.com on capable browsers 30 © Nokia 2012 Intro to Maps on Apps.pptx
  • 31. Positioning • Separate Optional Package for Positioning (JSR-179) • Frequently combined with the Nokia Maps API for Java ME, though not part of the API itself • Two location methods maybe available • Cell ID positioning • GPS 31 © Nokia 2012 Intro to Maps on Apps.pptx
  • 32. Cell-ID Location • A MIDlet can obtain an approximate position using the Cell-ID location method. • The method consists of passing the ID of the cell the device is currently connected to, on to a look-up service. The service will then return the well-known position of the given cell-ID. • This Cell ID location provides a method of positioning mobile devices which do not contain a GPS unit. Note: the degree of uncertainty can vary of a few meters to hundreds of kilometers, depending upon the infrastructure of the local network and the data available to the look-up service for that region 32 © Nokia 2012 Intro to Maps on Apps.pptx
  • 33. Cell-ID Example 1) Create a Cell-ID LocationProvider using LocationUtils Note: The second parameter of getLocationProvider() is currently always null. This leaves the library open for future extension 2) Make a call to getLocation() and process the result The attributes of the QualifiedCoordinate class map directly onto the GeoCoordinate class. Set up a loop and poll to obtain location updates. 33 © Nokia 2012 Intro to Maps on Apps.pptx
  • 34. LocationUtil • The preferred Location method(s) can be any combination of the methods defined in JSR-179: Useful Combinations • Offline Cell ID • Standalone GPS • Assisted GPS • Online Cell ID an/or WLAN 34 © Nokia 2012 Intro to Maps on Apps.pptx
  • 35. GPS Example 1. Create a GPS LocationProvider 2. Set the provider to start polling 3. Retrieve and process the result 35 © Nokia 2012 Intro to 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 Intro to Maps on Apps.pptx

Editor's Notes

  • #3: Intro – Why bother?Prereqs - What you need to get started how to get a basic map up on screen.Basic– blobs on the map - this is where the code will get started.Routing, search are included in the API
  • #5: 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.
  • #6: Does all the hard bits so you don’t have to bother.
  • #9: The Examples were built using Nokia SDK 1.0.The API will be integrated into Nokia SDK 2.0
  • #15: If phone supports landscape, map will display as landscape.Nokia-MIDlet-App-Orientation: landscape JAD file.You will want http permission javax.microedition.io.Connector.http
  • #18: 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.
  • #20: All map objects are created through the MapFactoryBalloon is the classic blob on the map. The right size for a thumb.Probably want to retain a reference to the marker. (When I Click on X do Y) getObjectsAt()Don’t make icons too small. Png for transparency.Readability of text – wouldn’t recommend it. Less is more . Use tooltip to get feedback.
  • #21: All map objects are created through the MapFactoryDefault width of a line.zoomTo
  • #22: Cust
  • #23: All map objects are created through the MapFactoryDefault width of a line.zoomTo
  • #24: Search/Places Routing make requests to online REST services, an interpret the result.Sharing is a URL minfying service for nokia maps – allows the return of an image.
  • #25: Geocoding is Address to Location.Can supply hint – The Toledo problem ( two cities similar size same name) = other example Hamilton. HENCE THE NULL above!
  • #26: How to get the central point of the map.
  • #27: A general places search - What is there to see and do around here?   A category-based places search - What restaurants are there within walking distance of here?A text based search – Is there a Chinese restaurant within walking distance?An in depth search – Is that Chinese restaurant within walking distance, open at this time of night, and is it any good?
  • #31: Synchronous (obviously)
  • #34: -1 is the timeout parameter
  • #36: -1 is the timeout parameterThe major difference between these two methods, is that the values of the interval update and time out parameters are set in a different way. In the first example both parameters are passed as arguments to the setLocationListener() method, while in the second example, the interval value is indirectly set by forcing the running thread to sleep for the given time, and the time out parameter is passed as argument when calling the getLocation() method. When frequent location queries are needed, setting a Location Listener should be preferred compared to repeatedly calling the getLocation() method for the following reasons: a) The call to getLocation() generates screen prompts because it requires the user's permission to query the location information. The same applies for the setLocationListener() method. The difference is, that the former is called continuously within the loop, thus making it impractical to use, unless the application is signed, while the latter is called only once. Note that whether the getLocation() method requires signing, in order not to prompt for the location retrieval, depends on the permission level needed per device. Using the setLocationListener() method, ensures that there are minimal prompts without the need to sign the application among the largest set of devices possible. b) By using the setLocationListener() method, it is possible for the implementation to reuse location results if it already has a recent location result when the update is due to be delivered. This is done by passing an additional argument, the maxAge parameter that defines how old the location result is allowed to be, when the update is made. However when the application needs to retrieve the device's location only once, the getLocation() method should be preferred. This is due to simplicity in the implementation. If the setLocationListener() method was preferred in this case, some additional logic would be needed so that the location listener was replaced by another one that does not listen for location updates, as soon as a valid location has been retrieved once. Otherwise, even if the application ignored the location updates provided by the locationUpdated() method, those would still run in the background, causing increased usage of battery power.