hi
i want to know the code to vibrate the mobile
tell me the apis u r using
and send me the function to vibrate the mobile
For the Nokia mobile
import javax.microedition.midlet.*;
import com.nokia.mid.ui.DeviceControl;
import javax.microedition.lcdui.*;
public class NokiaUITest extends MIDlet implements CommandListener{
private Command _cmdExit = null;
private Command _cmdVibrate = null;
private Command _cmdBacklightOn = null;
private Command _cmdBacklightOff = null;
private Command _cmdBacklightFlash = null;
private Form _mainForm = null;
private Display _display = null;
public NokiaUITest() {
_cmdExit = new Command("Schliessen", Command.EXIT, 1);
_cmdVibrate = new Command("Vibrieren", Command.SCREEN, 1);
_cmdBacklightOn = new Command("Backlight ON", Command.SCREEN, 2);
_cmdBacklightOff = new Command("Backlight OFF", Command.SCREEN, 2);
_cmdBacklightFlash = new Command("Flash Backlight", Command.SCREEN, 3);
_mainForm = new Form("Status NokiaUI Test:");
_display = Display.getDisplay(this);
_mainForm.addCommand(_cmdExit);
_mainForm.addCommand(_cmdVibrate);
_mainForm.addCommand(_cmdBacklightOn);
_mainForm.addCommand(_cmdBacklightOff);
_mainForm.addCommand(_cmdBacklightFlash);
_mainForm.setCommandListener(this);
}
protected void startApp() throws MIDletStateChangeException {
_display.setCurrent(_mainForm);
}
protected void pauseApp() { }
protected void destroyApp(boolean uc) { }
public void commandAction(Command cmd, Displayable disp) {
if(cmd == _cmdExit){
_mainForm.append("EXIT MIDlet... \n");
this.destroyApp(false);
}else if(cmd == _cmdVibrate){
_mainForm.append("Vibra for 2 Seconds (Freq:100)... \n");
DeviceControl.startVibra(100, 2000);
}else if(cmd == _cmdBacklightOn){
_mainForm.append("Turn Backlight ON \n");
DeviceControl.setLights(0, 100);
}else if(cmd == _cmdBacklightOff){
_mainForm.append("Turn Backlight OFF \n");
DeviceControl.setLights(0, 0);
}else if(cmd == _cmdBacklightFlash){
_mainForm.append("Flashing Light for 2s \n");
DeviceControl.flashLights(2000);
}
}
}Users browsing this forum: No registered users and 1 guest