开发者

Using the hardware volume buttons to control the volume in a j2me application, nokia phone

I'm writing a Java ME application for the Nokia 6212 phone. Part of what the application does is to play short videos, which works fine.

However, I have encountered a problem with volume control via the two buttons on the side of the phone. They don't seem to actually affect the application's volume, and don't even let me change it beyond a certain point on the 'range' widget that it brings up. Do I need to do anything in my progra开发者_运维技巧m to make this work? I know I can control the volume programatically via VolumeControl and a form of my own creation, but I don't really need that; I'd rather just let the user change it as needs be in a way that's intuitive for the phone.

Is this possible?


for questions like these just go the the keypressed function and add something like this:

 static public int debugKeyCode = 0;
 protected void keyPressed (int inKeyCode) {
       debugKeyCode = inKeyCode;
       //... remainder of code
 }

and in the paint just draw the keycode on the screen.

now start your app, press some hardware keys and you'll know the key to catch in case someone presses it

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜