J2memap Tutorial #1: Hello Map!
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) {
}
}
January 29th, 2007 at 1:30 am
HI, I will like to get J2memap library. We are working on an AVL system and I will like to include mobile maping.
Thanks in advance.
F.Boesche
February 21st, 2007 at 5:19 pm
Hi, I would like to get the j2memap library. I am using the Google maps API on my website but I’d like to make a PHP script on my website to display the maps on the phone emulator by making the requests to pass by my server and not directly from googlemaps. Is that possible? If you have any idea I’d be glad to hear it.
Thanks in advance.
Thierry
February 23rd, 2007 at 8:31 pm
Hi there.., great attempt in J2meMaps.. Am developing a j2me application that uses maps.. Ur blog will simplyfy my task if i have the libraries.. Can u plz help me out?
Thanks in Advance,
Harry.
March 2nd, 2007 at 6:07 am
Hi, would you send me the j2memap library.
Thank you so much!
March 8th, 2007 at 8:22 am
Hi there.., great attempt in J2meMaps.. Am developing a j2me application that uses maps..Plz send me library ASAP………
Thanx
Regards
March 10th, 2007 at 1:28 am
I wonne try to use J2ME Map to put location information from an other application in WM5.0 on a map. if possible i would like to get the j2memap library. Thx
April 6th, 2007 at 9:15 am
Hi,
I am developing an application that one of its feature is showing map. From google map api. But until now, I got error message, I could not display the map.
Is it possible for me to ask the j2memap library. I would like to try it. Would you like to send it? Thank you.
April 6th, 2007 at 2:13 pm
where is the other tutorial?
April 11th, 2007 at 1:36 pm
hi,
I dont know why if I create new sample of j2memap it will always shown error
April 18th, 2007 at 6:14 pm
Hello,
I am working om my master report, and I am developing a map service. I wondered if I could get the j2memap library and test it?
best regards
Rune
May 8th, 2007 at 5:07 pm
Hey There,
I’m really impressed with your mapping work and I’d be very interested in developing GPS applications for symbina phones…
My idea would be to use POI information for the UK (speed cameras, interesting points… pubs
etc) then mash the up on a gmap. Obviously this would mature over time… I was hoping to release it free (assuming a test doesn’t annhilate the bw on our servers)…
Would I be able to nab a copy of your libraries and maybe an example of how to put the map onto a JFrame etc?
July 1st, 2007 at 4:55 am
I’d like to make a mobile application which shows current position on the screen as a map. and I’m so excited that you have a library which would make me do that quite easily. Can I get a copy of your j2memap library please? Of course I’ll put your name as a copyright. thanks in advance.
October 7th, 2007 at 1:37 am
Hi,
We are working on our master project that shows the current position of the user and his/her friend on mobile client. Is it possible if we can get the j2memap library and test it?
Thanks,
-Diane
October 9th, 2007 at 9:19 am
Hello Diane,
Just go to http://j2memap.8motions.com and register to download the SDK which contains the library. If you have any issue, you can use the forum (http://forum.8motions.com )
Regards;