Home | Русский

J2ME – Form

A form is a collections of instances of the Item interface. The TextBox class (discussed in the preceding section) is a standalone UI element, while the TextField is an Item instance. Essentially, a textbox can be shown on a device screen without the need for a form, but a text field requires a form.
An item [...]

Posted in: J2ME by admin No Comments , ,

J2ME – TextBox

TextBox
Text is entered by the user using a textbox. Like the other UI elements, a textbox has simple features that can be set based on your requirements. You can restrict the maximum number of characters that a user is allowed to enter into a textbox, but you need to be aware of the fact that [...]

Posted in: J2ME by admin No Comments , ,

Convert ARGB to RGB in J2ME

Creating an image from an array of data is an easy task, but to create a byte-array of data from an image is a little more complicated.
To create a byte-array of data from an image, we can use the getRGB(..) method in the image class in MIDP 2.0.
From the getRGB method we get an int-array [...]

Posted in: J2ME by admin No Comments , ,

J2ME – Http Connection

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

public class httpconnection extends MIDlet implements CommandListener {
private Command exit, start;
private Display display;
private Form form;
public httpconnection ()
{
display = Display.getDisplay(this);
exit = new Command(”Exit”, Command.EXIT, 1);
start = new Command(”Start”, Command.EXIT, 1);
[...]

Posted in: J2ME by admin No Comments , ,

J2ME – SOCKET connection

This J2ME sample program shows how to how to make a SOCKET Connection from a J2ME Phone.
Many a times there is a need to connect theto a backend HTTP server from the J2ME application. This free J2ME sample program for example shows how to make a SOCKET connection from the phone to port 80 of [...]

Posted in: J2ME by admin 1 Comment , ,

J2ME Program – change font size and color

This J2ME sample program shows how to CHANGE THE FONT SIZE and CHANGE COLOR.
Having worked with many different J2ME devices, I have come across many phones with small displays or small defaul fonts and sizes. However in real time usage, most of the times the customer needs a bigger font size. This sample J2ME code [...]

Posted in: J2ME by admin No Comments , ,

Thread – Background Processing

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

public class BackgroundProcessing extends MIDlet
implements CommandListener {

private Display display;
private Form form;
private Command exit;
private Command start;

public BackgroundProcessing() {
[...]

Posted in: J2ME by admin No Comments ,