The target devices for the Maps API for Java ME are those supporting the Mobile Information Device Profile (MIDP) 2.0 or later for Java Micro Edition. This page described how to set up your development environment correctly, so you can start creating applications using the Maps API for Java ME.
Note: The development set up process described below has been optimised for the NetBeans and Eclipse IDEs, although any IDE for Java development may be used.
If you are new to Java development or development for Series 40 phones, check out the Java getting started section. In this section you can find detailed guides to setting up and using the NetBeans and Eclipse IDEs with the Nokia SDK 1.1 for Java.
1. Ensure that your IDE is present on your development machine.
2. To emulate a Series 40 phone, download the latest Nokia SDK for Java . The installation will automatically integrate support
with NetBeans or Eclipse if they are present on your machine. Note that the Nokia SDK 1.10 for JavaSDK requires use of JDK
6 Update 27 or earlier.
3. At this point you can download the binary JAR of the Maps API for Java ME
4. Acquire a set of API Credentials from the API Registration page at Nokia Developer and register your application for free. Please read the Location API Business Models and Usage Restrictions page, so that you can decide which business model fits your needs best.
For general guidance and an introduction to Java ME development, check out the Nokia Developer Guide.
In order to run the API successfully:
When setting up your emulator:
Maps API for Java ME invokes an authentication service when accessing maps online. Although it is possible to obtain access without acquiring authentication credentials, such access may be restricted or of inferior performance. In order to get the full potential out of the API, you must get credentials that authenticate your application against the Services. 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 authentication itself requires your unique Maps API credentials, namely AppId and Token. You can get these credentials from the API Registration page at Nokia Developer.
After registering your application, you must set the following credentials in the ApplicationContext class:
The following code , when added to a MIDlet, displays a basic map of the world. The map centers on the Gulf of Guinea at 0° longitude, 0° latitude. You can pan/zoom the map by default.
Display display = Display.getDisplay(this);
MapCanvas mapCanvas = new MapCanvas(display);
The Maps for Java ME API can draw a variety of shapes such as circles, rectangles and polylines over a map. Two types of markers
are supported. You can either use the predefined standard markers or include your own image resources with your application
and use custom markers. The following example shows how to add a
MapStandardMarker marker = mapFactory.createStandardMarker (new GeoCoordinate(55.583, 13.033,0));
The Maps for Java ME API provides access to online services such as search and routing. Search is able to specify a GeoCoordinate for an address or vice versa, and can retrieve a list of points of interest nearby. It can also be queried for more details about a point of interest. The routing service may be used to find a way to travel between two or more GeoCoordinates. For further details on how to use these services please check the routing and search examples.