Skip to content
This repository

Home 

Tomi Paananen edited this page · 2 revisions

Pages 1

Clone this wiki locally

The HERE Maps API for Java ME is a set of programming interfaces, allowing you to develop mobile device applications based on HERE Maps. The API, which has been integrated as a plug-in into the Noka Asha SDK, provides mapping, search, and routing functionality and targets devices that support the Mobile Information Device Profile (MIDP) for Java Micro Edition, such as Nokia Asha and Series 40 devices. Furthermore, although these demos have been written to be used with the latest Asha Platform, they are fully backwards compatible with older series 40 phones.

Basic map view  Berlin, satellite view

Geocoding  Routing

This project consists of the source code and video demonstrations of a series of custom map components using the HERE Maps API for Java ME plugin. The examples are meant to show how to extend the basic map functionality to use the additional capabilities of full youch phones.

Features supported by the library

  • Multiple map types.
  • Customisable markers.
  • Searching and Routing.
  • Polygon and polylines.
  • Map overlay supports.
  • Overlay support for custom labels and images.
  • Touch and standard key-binding support for panning and touch.
  • Places Support.

Place review  Place view

Supported devices and platform

Java Technology (JSR) 139 Connected, Limited Device Configuration (CLDC) 1.1 and Mobile Information Device Profile (MIDP) 2.0, JSR 118 devices.

Tested on Nokia Asha 311 and Nokia Asha 501. Developed with Netbeans 7.1 and Nokia Asha SDK 1.0.

Integration instructions to developers

Before starting, please acquire a set of API Credentials from the API Registration page at Forum Nokia and register your application for free. See Using Access Credentials.

Please read through the Location API Business Models and Usage Restrictions page so that you can decide which business model fits your needs best. The page is located at http://developer.here.com/plans.

There are fifteen MIDlets that are contained in the example project. These are Minimal Map Example, Map Type Example, Search Example, Marker Example, Custom Marker Example, Routing Example, Cached Map Example, Place Search, Share My Map, Tweets On My Map, and KML Data Example.

The examples were created using !NetBeans 7.1 and Nokia Asha SDK 1.0. The project can be easily opened in NetBeans by selecting 'Open Project' from the File menu and selecting the application.

To install the application on a phone, transfer the file MapsAPIExamples.jar to the phone via Nokia Suite or via Bluetooth. The examples demonstrate the following features:

  1. Basic Map Example: This MIDlet displays a map and demonstrates how to move the map center and change the map zoom level.
  2. Map Type Example: This MIDlet displays a map and demonstrates how to display and change between different map types.
  3. Map Language Example: This MIDlet displays the map in one of eight random languages.
  4. Address search: This MIDlet displays a map and demonstrates the geocoding and reverse geocoding functionality.
  5. Marker Example: This MIDlet displays a map and demonstrates how to place a marker on the map, and make it draggable using a MapComponent.
  6. Custom Marker Example: This MIDlet displays a map and demonstrates how to place a marker with a custom icon image on the map.
  7. Routing Example: This MIDlet displays a map and demonstrates how to calculate a route between multiple waypoints that are selected on the displayed map.
  8. Cached Map Example: This MIDlet displays a map and demonstrates file based caching for the map tiles.
  9. Place Search: This MIDlet uses the place search from the Search manager to locate various places and displays these on the map.
  10. Share My Map: This MIDlet displays a map and allows the map to be shared via SMS with another device.
  11. Tweets On My Map: This MIDlet allows you to search for Twitter messages containing a search term and displays these on the map.
  12. KML Data Example: This MIDlet illustrates how KML data can be parsed and used to create objects on the map.
  13. Adding an overlay: This MIDlet illustrates how to place an overlay over the base map, by combining two maps of Berlin.
  14. Basic Map components: This MIDlet illustrates the usage of the five standard map components and serves as an introduction to simple custom map components.
  15. Locate the device: This MIDlet demonstrates how to make a request to the location API and display the location of the device on a map.

Custom component demos

The following MIDlets demonstrate the use of custom components as found in the map-components.jar.

  1. Type Selector Component: This MIDlet demonstrates adding a map type selector button to the screen. This allows the user to switch between the five standard map types. The button is a simple toggle, the UI is delegated to a separate class.
  2. Scale Bar Component: This MIDlet demonstrates adding a scale bar to the map. The length of the scale bar will alter on zoom and pan according to the Normalized Mercator projection, and the legend will switch between Metric and Imperial Measurements.
  3. Positioning Component: This MIDlet demonstrates adding a positioning geolocation button to the map. When the button is pressed, the app will listen for GPS or Cell Id location events as appropriate, and update a marker to the center of the screen.
  4. Overview Component: This MIDlet demonstrates the use of the overview (picture-in-picture) button; the small Picture-in-Picture will track the central location of the main map as it is panned and zoomed.
  5. Infobubble Component: This MIDlet demonstrates a component that replaces a registered marker when it is centered on the screen. The Infobubble itself is clickable.
  6. Tooltip Component: This MIDlet demonstrates adding a series of tooltips to map markers. When a Map Marker is centered on the screen, a tooltip appears below it.
  7. Restrict Map Component: This MIDlet demonstrates the use of the Area restriction component. This prevents the user from panning/zooming outside of a chosen area.
  8. Focal Observer Component: This MIDlet demonstrates the use of the focal observer component. This means that when a MapObject is moved to the center of the screen, an event is fired in the MapCanvas.
  9. Context Menu Component (touch only): This MIDlet demonstrates the use of context menus on the map.
  10. Centering Component (touch only): This MIDlet demonstrates the use of the centering component. This means that when a MapObject is pressed, the map state is altered to bring it to the center of the map.
  11. Long Touch Component (requires gesture support): This MIDlet demonstrates a MapComponent responding to the Long Press event from the Gesture API.
  12. Pinch Zoom Component (requires gesture support): This MIDlet demonstrates a GestureMapCanvas responding to the Pinch event by zooming the map. Use of the GestureMapCanvas requires the presence of the Gesture API.

Individual Map Component demos

Click on the video below to see each of the custom Map Components in action.

Video: Custom Map Component Demos

More information is available at http://developer.here.com/java.

Known problems and limitations

  • Some map objects, such as rectangles, are not drawn correctly around the International Date Line (+/-180 degrees longitude).
  • On some KVMs it is not possible to download a map due to the name of the host that provides the default map tiles.
  • HOV Lane and Stairs RouteFeatures are not supported with the route calculations.

Full touch application demos

Several other fully functional demos are also available which combine the use of the various examples described with touch components to provide a complete application. Click on the demos below to see a series on how Touchable Map Components can be added to an existing application.

Video: Full Touch KML Demo

A demonstration of an enhancement to the standard KML Example offered as part of the HERE Maps API for Java ME. The demo has been optimised to use the features available on Full Touch Phones, such as the Asha 311.

The Default Cursor and Download Indicator have been removed as unnecessary, and replaced with the Centerer Component. Tooltips have also been added to offer visual feedback to the User prior to making a selection.

Video: Full Touch Places Demo

A demonstration of an enhancement to the standard Places Example offered as part of the HERE Maps API for Java ME. The demo has been optimised to use the features available on Full Touch Phones, such as the Asha 311.

The Default Cursor and Download Indicator have been removed as unnecessary, and replaced by a Centering Component and a Focal Observer. Whenever a MapObject is found at the centre of the screen the Place data is displayed using either an Infobubble or a Context Menu depending upon whether contact details can be found. The visual feedback means that the user is always offered the correct control to touch or make a further choice.

Video: Full Touch Routing Demo

A demonstration of an enhancement to the standard Routing Example offered as part of the HERE Maps API for Java ME. The demo has been optimised to use the features available on Full Touch Phones, such as the Asha 311.

The Default Cursor and Download Indicator have been removed as unnecessary and replaced by a Centering Component. Map Markers are added using the Long Press Gesture, and additional Actions have been hidden away using a Side bar component. The side bar copies the look-and-feel of the draggable handle familiar from the virtual keyboard interface and reveals a series of touchable icons.

Something went wrong with that request. Please try again.