tags:

views:

221

answers:

1

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

+1  A: 

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

Toad
The odd thing is that it does bring up a "volume 'gauge'" when you press those buttons. You just can't move it past certain points. I'll have a look and see if the canvas button events pick up the volume control buttons.
David N. Welton
No, it's as I thought. The hardware volume buttons bring up a little volume dialog, and do not register as 'keyPressed' events, so that route really won't work, at least on this particular phone.
David N. Welton