fioricet tablets cheapest fioricet brand name fioricet on line pharmacies for fioricet 100 count c o d order fioricet no prescription fioricet c o d discount fioricet fioricet information fioricet overnight fioricet cash on delivery purchase fioricet online order fioricet buy cheap generic fioricet fioicet firoicet cheap fiorcet buy generic fioricet fioricet picture fioricet tab fioricet saturday delivery name brand fioricet impact health care name brand fioricet buy fioricet cheap buy the drug fioricet online discount fioricet overnight prescriptions fiorcet how to buy fiorcet cheap generic fioricet online fioricet withdrawal info fioricet

Archive for January 20th, 2007

J2memap Tutorial #1: Hello Map!

Saturday, January 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: , , , ,