Home | Русский

How to create a Gauge Tracker

This example shows how to create a Gauge tracker in MIDP.

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class GaugeTracker extends MIDlet
implements ItemStateListener, CommandListener {

private Gauge mGauge;
private StringItem mStringItem;

[...]

Posted in: J2ME by admin No Comments ,

How to Send an HTTP POST and GET Requests

As you might imagine, sending an HTTP POST request is a very similar process to sending a GET request.
See example.

public void httpRequest(){
Connect.getInstance().setParam(”all”, “getall”));
Connect.getInstance().setParam(”sessionid”, “64654sdf465sadf4″);
Connect.getInstance().doPost(”http://freesrc.com/”);
while (Connect.getInstance().isActive()) {
Thread.sleep(20);
}
[...]

Posted in: J2ME by admin No Comments , , ,

J2ME – How to write – read image in – from RMS

The example below saves image file into RMS and shows it on mobile.
Data like image, image name, width, height can be stored in RMS.
The size of the image file do matters if phone capacity is small.
Sample.java

package freesrc.com;

import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Image;
import javax.microedition.midlet.*;

/**
* @author freesrc.com
*/
public class Sample extends MIDlet {

private Display [...]

Posted in: J2ME by admin No Comments , , , ,