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

Tutorial: loading a KML file using the J2memap library

Ok, following some requests, here is another tutorial on how to use the J2memap library. First, note that if you just want to display a KML file on mobile, you can use 8Motions directly, no need to create your own application.

Anyway, here we are going to show you how to create a very simple app that display a KML file on a cell phone. First, download the J2memap library (you need to be registered to download it), and put thelibraryCLDC11.jar (or 10.jar) as a library of your project. In netbeans, you do Properties,add jar/zip,select the jar file.

Here I take a KML file, but it could be also a GPX file, LOC or GEORSS file….

Then, here is the code:

package com.eightmotions.LoadTrack;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import com.eightmotions.util.*;
import com.eightmotions.map.*;
/**
 *
 * @author tlandspurg
 * @version
 */
public class LoadTrack extends MIDlet implements TrackNotifier {

    MapCanvas m_map;
    Display m_display;
    public void startApp() {
        UtilMidp.checkMIDP(this); //Initialise the utility library…

        // Initialize the map, get the display, and put the map on it
        m_map=new MapCanvas();
        m_display=Display.getDisplay(this);
        m_display.setCurrent(m_map);     

        // Load a track, and display this track to a map
        Track track=Track.getTrack(m_display,“http://www.8motions.com/map/showKml/107″,“Loading Track”,m_map);
        // Listen for track loaded event…
        track.setNotifier(this);
    }

    public void pauseApp() { }

    public void destroyApp(boolean unconditional) {   }

    /* When the track has been loaded, display it… */
    public void onTrackLoaded(Track tr) {
        m_map.displayTrack(tr,true);
    }

    public void onTrackCreated(Track t) { };

    public void onTrackSaved(Track t) {};
}

Here is the result:

One Response to “Tutorial: loading a KML file using the J2memap library”

  1. thomas.landspurg Says:

    Testing WP2.5 install….

Leave a Reply