IT Community - Software Programming, Web Development and Technical Support

Any idea about how to develop vibration & backlights application...

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?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > Mobile Software Development

Register FAQ Members List Calendar Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 07-24-2007, 06:28 AM
mobilegeek mobilegeek is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 205
mobilegeek is on a distinguished road
Default Any idea about how to develop vibration & backlights application...

How to develop vibration and backlights application in mobile using j2me?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-24-2007, 06:45 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Re: Any idea about how to develop vibration & backlights application...

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);

}

}
}
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-08-2007, 04:07 AM
amansundar amansundar is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 325
amansundar is on a distinguished road
Default Re: Any idea about how to develop vibration & backlights application...

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
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT -7. The time now is 08:57 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0