0

I programmed a bluetooth Television-Remote control for cellphones in J2ME using javax.microedition.lcdui.* (Gauge, List, ChoiseGroup) GUI-Elements.

I want the cellphone to have real-time interaction with my Television, I would like to find way to send user inputs performed with the GUI-Elements immediately (like changing the channel, or changing the volume) to the Television.

Since I want real-time interaction with my Television, I would like to find way to send user inputs performed with the GUI-Elements immediately (e.g. changing the channel, or changing the volume) to the TV.

Using javax.microedition.lcdui.Command / CommandListner and commandAction won't work since these need only recognize the commands selected with the side buttons. I would like to have something that can recognize any key pressed.

I discovered that Javax.microedition.lcdui.Canvas.keyPressed can handle any key pressed on the cellphone, but I don't know how to make Canvas work with MIDP GUI elements like Gauge. They can't be added like Commands.

Do I have to figure out way to build a interface for these GUI elements to make them work with Canvas?

Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
zhengtonic
  • 720
  • 12
  • 25

4 Answers4

2

I just found a half solution myself, if anyone is interested: "javax.microedition.lcdui.ItemStateListener". This function can handle the states (or state changes) of the GUI items in realtime. Its not keyPress, but this will work as well for my application.

zhengtonic
  • 720
  • 12
  • 25
1

According to this FAQ you can't do what you are asking for. This is about MIDP 1.0, but I believe it also applies for MIDP 2.0. If it is only a gauge you need, you can easily paint it yourself.

kgiannakakis
  • 103,016
  • 27
  • 158
  • 194
0

From what I saw this can only be done using a Canvas.

Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614
-1

I will strongly recommend that you should either draw your Gauge-like item on a Canvas object or you follow the advice given on Dec 19 at 15:00 by "zhengtonic". I dont know any other approach to this problem, I was once there but used the first options provided by me