Search code examples
java-melwuitmidp

How to get hard volume key event in J2ME LWUIT?


I am having a media player application built using LWUIT. My problem is that I am unable to increase/decrease the volume of the media player when the user presses any volume hardware key of the device. Please help.


Solution

  • Create an app with a plain Canvas and run it on your device. On the canvas's keyPressed function, print the results out to the screen. I suspect nothing will happen when you press the volume keys, in which case you have no way of doing anything when these keys are pressed.