Probieren Sie diesen Code aus und sehen Sie, ob er funktioniert. Es funktionierte für mich auf nokia e63
package ravi.vibrationClass;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class Vibrate extends MIDlet implements CommandListener{
Form form;
Display disp;
Command vib,exit;
public void startApp() {
form = new Form("Vibration");
disp = Display.getDisplay(this);
exit = new Command("Exit", Command.EXIT, 1);
vib = new Command("Vibrate", Command.OK, 1);
form.append("Press \"vibrate\" to make the phone vibrate");
form.addCommand(vib);
form.addCommand(exit);
form.setCommandListener(this);
disp.setCurrent(form);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
notifyDestroyed();
}
public void commandAction(Command c, Displayable arg1) {
if(c == vib){
disp.vibrate(125);
}else if(c == exit){
destroyApp(true);
}
}
}