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.
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.
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:
- Basic Map Example: This MIDlet displays a map and demonstrates how to move the map center and change the map zoom level.
- Map Type Example: This MIDlet displays a map and demonstrates how to display and change between different map types.
- Map Language Example: This MIDlet displays the map in one of eight random languages.
- Address search: This MIDlet displays a map and demonstrates the geocoding and reverse geocoding functionality.
Marker Example: This MIDlet displays a map and demonstrates how to place a marker on the map, and make it draggable using a
- Custom Marker Example: This MIDlet displays a map and demonstrates how to place a marker with a custom icon image on the map.
- Routing Example: This MIDlet displays a map and demonstrates how to calculate a route between multiple waypoints that are selected on the displayed map.
- Cached Map Example: This MIDlet displays a map and demonstrates file based caching for the map tiles.
- Place Search: This MIDlet uses the place search from the Search manager to locate various places and displays these on the map.
- Share My Map: This MIDlet displays a map and allows the map to be shared via SMS with another device.
- Tweets On My Map: This MIDlet allows you to search for Twitter messages containing a search term and displays these on the map.
- KML Data Example: This MIDlet illustrates how KML data can be parsed and used to create objects on the map.
- Adding an overlay: This MIDlet illustrates how to place an overlay over the base map, by combining two maps of Berlin.
- Basic Map components: This MIDlet illustrates the usage of the five standard map components and serves as an introduction to simple custom map components.
- 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
- 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.
- 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.
- 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.
- 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.
- Infobubble Component: This MIDlet demonstrates a component that replaces a registered marker when it is centered on the screen. The Infobubble itself is clickable.
- 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.
- 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.
Focal Observer Component: This MIDlet demonstrates the use of the focal observer component. This means that when a
MapObjectis moved to the center of the screen, an event is fired in the
- Context Menu Component (touch only): This MIDlet demonstrates the use of context menus on the map.
Centering Component (touch only): This MIDlet demonstrates the use of the centering component. This means that when a
MapObjectis pressed, the map state is altered to bring it to the center of the map.
Long Touch Component (requires gesture support): This MIDlet demonstrates a
MapComponentresponding to the Long Press event from the Gesture API.
Pinch Zoom Component (requires gesture support): This MIDlet demonstrates a
GestureMapCanvasresponding to the Pinch event by zooming the map. Use of the
GestureMapCanvasrequires 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.
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
RouteFeaturesare 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.
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.
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.
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.