J2memap Tutorial #1: Hello Map!

By admin • janvier 20th, 2007

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) {
    }
}

Technorati Tags: , , , ,

Comments

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

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

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.

By jupiter9244 on mars 2nd, 2007 at 06:07

Hi, would you send me the j2memap library.
Thank you so much!

By googlemaphelp on mars 8th, 2007 at 08:22

Hi there.., great attempt in J2meMaps.. Am developing a j2me application that uses maps..Plz send me library ASAP………

Thanx
Regards

By Kris Joris on mars 10th, 2007 at 01:28

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

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.

where is the other tutorial?

hi,

I dont know why if I create new sample of j2memap it will always shown error

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

By Miles Burton on mai 8th, 2007 at 17:07

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?

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.

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

By thomas.landspurg on octobre 9th, 2007 at 09:19

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;

I’d like to make a mobile application which shows current position on the screen as a map.Can I get a copy of your j2memap library please. Thanks in advance.

Hi,
I’m working on a LBS-project in a computer science class and need to work with maps. Downloaded the j2me map on my phone so would you please send the library?

Thanks, Irene

Hello,

I am working on a mobile phone application for my FYP. Could you please provide the j2memap library?

Thanks in advance

 

Leave a Comment

« V09.17 | Home | J2memap is used on E90! »