I will start a series of tutorial around J2memap as a powerful library to be used to display gelocalized content.

This first tutorial will focus on the easiest thing to do: display a map on a phone! With a few line of codes, you will have the equivalent of GoogleMap on your PC...

That's quite easy. You can do this using Java Wireless Tool Kit. Create a new project (in that case "HelloMap"), give the midlet class name (in this example net.landspurg.test.HelloMap ). Just put the library (you need to contact me to get it) in the "libs" folder of this project.

The steps are pretty simple:

* intialize utilities:

UtilMidp.checkMidp(Midlet)

* Then, create a map canvas:

MapCanvas m_map=new MapCanvas();
m_map.init();

* Now, display it:

display.setDisplay(m_map);

Now, you have a fully fonctional GoogleMap/Yahoo/Ask.com/MSN Live interface, with scrolling, zooming, etc...

All these default behavior can be changed, will see this later on....

The complete source code is here:

/*
* HelloMap.java
*
* Created on 11 janvier 2007, 20:10
*/

package net.landspurg.test;

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import net.landspurg.util.*;
import net.landspurg.map.*;
/**
*
* @author tlandspurg
* @version
*/
public class HelloMap extends MIDlet {
MapCanvas m_map;
public void startApp() {
// DO NOT FORGET TO INITIALISE UtilMidp! contains some static function
// used by MapCanvas....
//
UtilMidp.checkMIDP(this); //Initialise the utility library...
m_map=new MapCanvas();
m_map.init();
Display d=Display.getDisplay(this);
d.setCurrent(m_map);
}

public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
}
}