Maps API for Java ME FAQ
[B]Q: What is the Maps API for Java ME?[/B]
The Maps API for Java ME is a set of programming interfaces, allowing you develop mobile device applications based on Nokia Maps. The API provides mapping, search and routing functionality and targets devices that support the Mobile Information Device Profile (MIDP) for Java Micro Edition, such as Nokia Series 40 devices.
[B]Q: Where can I find examples of the API in action?[/B]
There are Code Examples bundled with the ZIP download. A series of commentaries explaining the basic functionality can be found here: [url]http://www.developer.nokia.com/Develop/Maps/Maps_API_for_Java_ME/Code_examples/[/url]
Further examples can be found on the Community Wiki:
[B]Q: Where do I get an app_id and token?[/B]
An app_id and token can be obtained from [url]http://api.developer.nokia.com/[/url] provided you have a Nokia Developer Account.
As it mentions on the right hand side of the api page. If you are not registered yet as a Nokia Developer, please fill in the registration form
and you will be able to access the tools and resources you need for application development.
[B]Q: How do I generate an new app_id and token.[/B]
1) Log in to [url]http://api.developer.nokia.com/[/url]
2) Click on NEW APP.
3) Once an app_id and token pair is generated, click on the name of your app to see the details, you should see something like:
[B]App ID:[/B] zqq7NvxXXXK9FGhk6zgAE
The token is the longer string of the two, the app_id is the shorter string do not use the name of the app.
You should generate a new app id for each application you create.
[B]Q: Where is the reference documentation for this API ?[/B]
The JavaDoc is available as part of the download. See here: [url]http://www.developer.nokia.com/Develop/Maps/Maps_API_for_Java_ME/[/url]
[B]Q: What is the relationship between the Maps API for Java ME and the Map Image API?[/B]
The Maps API for Java ME gives you a pannable, zoomable [I]MapCanvas [/I], whereas the Map Image API gives you a simple [B]static [/B]map. Both APIs are usable on Java ME devices, but in general you should tend towards using Maps API for Java ME if you want to do anything complex, or if you need a series of images since the API caches and reuses map tiles which reduces the bandwidth required. In summary, only use the Map Image API for single, one-off maps.
[B]Q: How do I combine the MapCanvas with a GameCanvas?[/B]
Usually this is a not a good idea, since downloading map tiles can be very slow and data intensive. If you need to do this make sure that you add a semaphore around the parts of the code which cause the MapCanvas to be updated. This avoids the situation where additional unserviced map tile requests get added to the rendering queue eventually causing the API to run out of resources.