public class regThread extends Thread{
public void run(){
try {
long delay = Integer.parseInt(tf.getString()) * 1000;
long curTime = (new Date()).getTime();
System.out.println(c delay);
PushRegistry.registerAlarm("WakeUp", c delay);
mainForm.append("Alarm registered successfully");
} catch (NumberFormatException nfe) {
mainForm.append("FAILED\nCan not decode delay " + nfe);
} catch (ClassNotFoundException cnfe) {
mainForm.append("FAILED\nregisterAlarm thrown " + cnfe);
} catch (ConnectionNotFoundException cnfe) {
mainForm.append("FAILED\nregisterAlarm thrown " + cnfe);
}
}
}
}
SMS_send.java
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import javax.microedition.io.PushRegistry;
import javax.wireless.messaging.*;
import javax.microedition.io.*;
public class SMS_send extends MIDlet implements CommandListener{
public Display display;
public static Form messageForm;
public static Form mainForm;
public static Command exitCommand;
Java ME Developer Guide
Chapter 22 - Network APIs
[163/201]
DRAFT - Subject to Change