Archive for the 'j2me source code' Category
import org.bouncycastle.crypto.*;import org.bouncycastle.crypto.engines.*;import org.bouncycastle.crypto.modes.*;import org.bouncycastle.crypto.params.*;
public class Encryptor {
private BufferedBlockCipher cipher;private KeyParameter key;
// inisialisasi engine kriptografi.// array key paling sedikit 8 bytes.public Encryptor( byte[] key ){cipher = new PaddedBlockCipher(new CBCBlockCipher(new DESEngine() ) );this.key = new KeyParameter( key );}
// inisialisasi engine kriptografi.// string paling sedikit 8 chars.public Encryptor( String key ){this( key.getBytes() );}
private byte[] callCipher( byte[] data […]
November 22nd, 2007 | Posted in j2me sample, j2me source code | No Comments
/*————————————————–
* ViewPngThread.java
*
* Download and view a png file. The download is
* done in the background with a separate thread
*
* Example from the book: Core J2ME Technology
* Copyright John W. Muchow http://www.CoreJ2ME.com
* You may use/modify for any non-commercial purpose
*————————————————-*/
[…]
July 23rd, 2007 | Posted in j2me example, j2me gui, j2me multimedia, j2me sample, j2me source code | 1 Comment
/*————————————————–* GameActions.java** Canvas for processing game actions** Example from the book: Core J2ME Technology* Copyright John W. Muchow http://www.CoreJ2ME.com* You may use/modify for any non-commercial purpose*————————————————-*/ import javax.microedition.midlet.*;import javax.microedition.lcdui.*;
public class GameActions extends MIDlet{ private Display display; // The display […]
July 19th, 2007 | Posted in j2me example, j2me gui, j2me sample, j2me source code | No Comments
//jad file (please verify the jar size)/*MIDlet-Name: DisplayAlertMIDlet-Version: 1.0MIDlet-Vendor: MyCompanyMIDlet-Jar-URL: DisplayAlert.jarMIDlet-1: DisplayAlert, , DisplayAlertMicroEdition-Configuration: CLDC-1.0MicroEdition-Profile: MIDP-1.0MIDlet-JAR-SIZE: 100
*/import javax.microedition.lcdui.Alert;import javax.microedition.lcdui.AlertType;import javax.microedition.lcdui.Command;import javax.microedition.lcdui.CommandListener;import javax.microedition.lcdui.Display;import javax.microedition.lcdui.Displayable;import javax.microedition.lcdui.Form;import javax.microedition.midlet.MIDlet;import javax.microedition.midlet.MIDletStateChangeException;
public class DisplayAlert extends MIDlet implements CommandListener { private Display display;
private Alert alert;
private Form form = new Form(”Throw Exception”);
private Command exit = new […]
July 19th, 2007 | Posted in j2me example, j2me gui, j2me multimedia, j2me sample, j2me source code | No Comments
/*————————————————–* AccessingCommands.java** Example from the book: Core J2ME Technology* Copyright John W. Muchow http://www.CoreJ2ME.com* You may use/modify for any non-commercial purpose*————————————————-*/import javax.microedition.midlet.*;import javax.microedition.lcdui.*;
public class AccessingCommands extends MIDlet implements CommandListener{ private Display display; // Reference to Display object private Form fmMain; […]
July 19th, 2007 | Posted in j2me example, j2me gui, j2me multimedia, j2me sample, j2me source code | 1 Comment
/* * @(#)Sample.java 1.9 01/06/08 * Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved. */
import javax.microedition.midlet.*;import javax.microedition.lcdui.*;
/* * A quick sample of graphics, commands, and event handling. */public class SampleCanvasMIDlet extends MIDlet implements CommandListener { Display display; Command exitCommand; Command backCommand; […]
July 19th, 2007 | Posted in j2me example, j2me gui, j2me sample, j2me source code | 4 Comments
/*
J2ME: The Complete Reference
James Keogh
Publisher: McGraw-Hill
ISBN 0072227109
*/
// jad file (Please verify the jar size first)
/*
MIDlet-Name: BackgroundProcessing
MIDlet-Version: 1.0
MIDlet-Vendor: MyCompany
MIDlet-Jar-URL: BackgroundProcessing.jar
MIDlet-1: BackgroundProcessing, , BackgroundProcessing
MicroEdition-Configuration: CLDC-1.0
MicroEdition-Profile: MIDP-1.0
MIDlet-JAR-SIZE: 100
*/
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()
{
display = Display.getDisplay(this);
form = new Form(”Background Processing”);
exit = new Command(”Exit”, Command.EXIT, 1);
start = […]
July 17th, 2007 | Posted in j2me example, j2me sample, j2me source code | 1 Comment
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
import javax.microedition.rms.*;
import java.io.*;
public class ImageStore extends MIDlet implements CommandListener {
private Command CmdExit;
private Command CmdOpen;
private Command CmdBack;
private Command CmdSave;
private Display display;
RecordStore rStore;
Form form = null;
Image image = null;
InputStream is =null;
public ImageStore() {
rStore = null;
display = Display.getDisplay(this);
CmdExit = new Command(”Exit”, 1, 2);
CmdOpen = new Command(”Show”, 1, 3);
CmdBack = new Command(”Back”, 1, 3);
CmdSave = new […]
July 16th, 2007 | Posted in j2me example, j2me rms, j2me sample, j2me source code | 1 Comment
/*J2ME in a NutshellBy Kim TopleyISBN: 0-596-00253-X
*/
import java.util.Timer;import java.util.TimerTask;import javax.microedition.lcdui.Canvas;import javax.microedition.lcdui.Command;import javax.microedition.lcdui.CommandListener;import javax.microedition.lcdui.Display;import javax.microedition.lcdui.Displayable;import javax.microedition.lcdui.Form;import javax.microedition.lcdui.Gauge;import javax.microedition.lcdui.Graphics;import javax.microedition.lcdui.Item;import javax.microedition.lcdui.ItemStateListener;import javax.microedition.midlet.MIDlet;
public class AnimationMIDlet extends MIDlet implements CommandListener, ItemStateListener {
[…]
July 16th, 2007 | Posted in j2me example, j2me gui, j2me multimedia, j2me sample, j2me source code | 2 Comments
/*————————————————–* ChoiceGroupWithImages.java** Example from the book: Core J2ME Technology* Copyright John W. Muchow http://www.CoreJ2ME.com* You may use/modify for any non-commercial purpose*————————————————-*/import javax.microedition.midlet.*;import javax.microedition.lcdui.*;
public class ChoiceGroupWithImages extends MIDlet implements CommandListener{ private Display display; // Reference to display object private Form fmMain; […]
July 16th, 2007 | Posted in j2me example, j2me gui, j2me sample, j2me source code | 1 Comment