Categories: Java | Java ME | How To | Code Examples | UI
This page was last modified 08:53, 25 September 2007.
How to vibrate phones from Java ME
From Forum Nokia Wiki
To vibrate a MIDP2.0 phone in Java ME by using the following method in javax.microedition.lcdui.Display class.
Display.getDisplay(this).vibrate(500);
The duration parameter(in this case 500) is the number of milliseconds the vibrator should be run.
Note, that the duration of the vibration can be limited on certain devices. For example on S60 devices the limit is 10 seconds.
For MIDP 1.0 phones having Nokia UI support you may use the following code which is deprecated in MIDP2.0 phones
com.nokia.mid.ui.DeviceControl.startVibra(50, 1000)
com.nokia.mid.ui.DeviceControl.startVibra(int freq, long duration) The above code activates vibration for a given length of time and frequency
To stop vibration the following code is to be executed
com.nokia.mid.ui.DeviceControl.stopVibra()
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| S40 5th LE Memory Question | cavalierski | Mobile Java General | 2 | 2008-06-06 08:45 |
| How Java run in non Symbian enabled phones? | jpklon | General Symbian C++ | 1 | 2003-10-02 13:59 |
| Java Tools | teksoft | Mobile Java Tools & SDKs | 1 | 2002-08-21 19:40 |
| Known Specs and Issues of All Java Phones | Woody_FX | Mobile Java General | 0 | 2004-02-04 20:34 |
| What is going on with Vibration on S60? | amd_rikus | Mobile Java General | 3 | 2006-06-16 00:29 |
