Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Intro to apps with maps for series 40

2,047 views

Published on

Consumers are looking for location-based apps to make their Series 40 phones smarter, easier to use, and more relevant to their mobile lives. Learn how to easily integrate Nokia Maps and services into your apps targeting Series 40 phones.

Published in: Technology, Education
  • Be the first to like this

Intro to apps with maps for series 40

  1. 1. Nokia Series 40Application Development withNokia Maps and Location APIsfor Series 40Jason FoxTechnical Support EngineerMaps Platform1 © Nokia 2012 Intro to Maps on Apps.pptx
  2. 2. Agenda1. Introduction to Nokia Maps API for Java ME2. Getting Started - Prerequisites3. Basic Mapping Concepts4. An Introduction to the Search and Routing Services5. An Introduction to positioning (JSR-179)2 © Nokia 2012 Intro to Maps on Apps.pptx
  3. 3. Nokia Maps API for Java ME3 © Nokia 2012 Intro to Maps on Apps.pptx
  4. 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 performanceFull details at :http://www.developer.nokia.com/Develop/Maps/Maps_API_for_Java_ME/ 4 © Nokia 2012 Intro to Maps on Apps.pptx
  5. 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. 6. Comparison of Nokia Maps for JavaME vs. Static Map Image SolutionsStatic 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. 7. Prerequisites7 © Nokia 2012 Intro to Maps on Apps.pptx
  8. 8. Prerequisites1. Install a Java Runtime Environment 6 http://www.java.com/en/download/index.jsp2. Install an IDE (e.g. NetBeans) Netbeans.org3. 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. 9. Prerequisites 1.4. Configure Nokia SDK in NetBeans 2. 3. 9 © Nokia 2012 Intro to Maps on Apps.pptx
  10. 10. Prerequisites5. 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. 11. Prerequisites6. Register as a developer free at www.developer.nokia.com 11 © Nokia 2012 Intro to Maps on Apps.pptx
  12. 12. Prerequisites7. 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 application8. 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. 13. Basic Mapping Concepts• The Minimal Map• An Introduction to Map Types• Map Languages• Markers• Polylines and Polygons• Interaction13 © Nokia 2012 Intro to Maps on Apps.pptx
  14. 14. The Minimal MapA 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. 15. Map TypesPick the right map type for your app 15 © Nokia 2012 Intro to Maps on Apps.pptx
  16. 16. Map Types – Simple MethodThe Standard Map SchemesThe Code16 © Nokia 2012 Intro to Maps on Apps.pptx
  17. 17. Map Types – Advanced Method1) Implement a MapSchemeListener and call getAvailableMaps()2) Handle Success and Failure3) Set the BaseMapType from MapProviders received 17 © Nokia 2012 Intro to Maps on Apps.pptx
  18. 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 English18 © Nokia 2012 Intro to Maps on Apps.pptx
  19. 19. Map MarkersMarkers highlight points of interest at a specified locationon 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. 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. 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 MapContainer21 © Nokia 2012 Intro to Maps on Apps.pptx
  22. 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 presses22 © Nokia 2012 Intro to Maps on Apps.pptx
  23. 23. An Introduction to Location-Based Services • Search (Geocoding and Reverse Geocoding) • Places Search • Routing • Sharing23 © Nokia 2012 Intro to Maps on Apps.pptx
  24. 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 GeoCodeRequestListener2. Create a GeoCodeRequest3. Handle Success or Failure24 © Nokia 2012 Intro to Maps on Apps.pptx
  25. 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 Failure25 © Nokia 2012 Intro to Maps on Apps.pptx
  26. 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. 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 Result27 © Nokia 2012 Intro to Maps on Apps.pptx
  28. 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 Failure28 © Nokia 2012 Intro to Maps on Apps.pptx
  29. 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 default29 © Nokia 2012 Intro to Maps on Apps.pptx
  30. 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 browsers30 © Nokia 2012 Intro to Maps on Apps.pptx
  31. 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 • GPS31 © Nokia 2012 Intro to Maps on Apps.pptx
  32. 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 ofkilometers, depending upon the infrastructure of the local network and thedata available to the look-up service for that region 32 © Nokia 2012 Intro to Maps on Apps.pptx
  33. 33. Cell-ID Example1) Create a Cell-ID LocationProvider using LocationUtils Note: The second parameter of getLocationProvider() is currently always null. This leaves the library open for future extension2) Make a call to getLocation() and process the resultThe attributes of the QualifiedCoordinate class map directly onto theGeoCoordinate class.Set up a loop and poll to obtain location updates. 33 © Nokia 2012 Intro to Maps on Apps.pptx
  34. 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 WLAN34 © Nokia 2012 Intro to Maps on Apps.pptx
  35. 35. GPS Example1. Create a GPS LocationProvider2. Set the provider to start polling3. Retrieve and process the result 35 © Nokia 2012 Intro to Maps on Apps.pptx
  36. 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/Maps36 © Nokia 2012 Intro to Maps on Apps.pptx

×