This is a discussion on Any idea about how to develop vibration & backlights application... within the Mobile Software Development forums, part of the Software Development category; How to develop vibration and backlights application in mobile using j2me?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| This code will help you... import javax.microedition.midlet.*; import com.nokia.mid.ui.DeviceControl; import javax.microedition.lcdui.*; public class vibramidlet 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 vibramidlet() { _cmdExit = new Command("Exit", Command.EXIT, 1); _cmdVibrate = new Command("Vibration", 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("Startvibra"); _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); notifyDestroyed(); } 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); } } } |
| |||
| I tried the above sample code on both NOKIA 3650(not worked) and NOKIA 7210(worked)..can some one tell what may be the reason for the above sample code working in nokia 7210 but not in the 3650...i have tried in n70 also but failed....
__________________ cheers Aman |
![]() |
| Thread Tools | |
| Display Modes | |
| |
LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/mobile-software-development/2653-any-idea-about-how-develop-vibration-backlights-application.html | |||
| Posted By | For | Type | Date |
| DiscussWeb IT Community - Fusing | This thread | Refback | 08-08-2007 04:46 AM |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to Develop an Simple Message Service Component(SMS) of my own? | Mramesh | C# Programming | 0 | 12-26-2007 03:55 AM |
| Microsoft going to develop document translator for blind | senthilkannan | Microsoft | 0 | 11-25-2007 11:41 PM |
| Practical issues when we develop code in Windows Forms in C#.Net 2005 | Sathish Kumar | C# Programming | 10 | 09-20-2007 07:17 AM |
| what is Vibration in J2ME | itbarota | J2ME | 3 | 08-08-2007 04:13 AM |
| What steps are needed to develop and run software tests? | itbarota | Software Testing | 1 | 07-23-2007 06:52 AM |