tags:

views:

116

answers:

1

I would like to listen the slide IN/OUT event of the NOKIA devices(Touch + QWERTY Keyboard) in J2ME App. I need your inputs for the same. Do i need to follow complex implementation or is there any other way around?Will midpjni help?

A: 

For handsets with QWERTY and Touch screens, the QWERTY keyboard is exposed when it is slid out and the screen changes to landscape mode (from portrait). So you can detect the sizeChanged(width, height) call, detect that handset went into landscape mode and then handle it.

There is a problem with this approach, if the handset changes into landscape mode based on accelerometer calls then this is inconsistent as then it can go into landscape mode without the QWERTY keyboard being slid out.

So a seemingly good approach is just listen for slide IN/OUT event and handle it. So yours is a good solution. However if your app needs to work on Non-Nokia handsets who dont support slide IN/OUT events.

So, a generic solution would be

  1. Handle portrait/landscape changes based on sizeChanged call.
  2. Make your key handling generic enough to support Virtual keypad and also QWERTY keyboard.

This may have been on tangent but hope it helps you understand this.

omermuhammed
I have a question here that how is it possible to listen slide in/out event in nokia devices?I have tried with key listener but no keypressed event generated on slide in/out event.How can I get that event in nokia device?
rajiv
I dont think there is a direct way to do this, there are no events specific to this that are sent. However, you will have to play around with canvas class's showNotify(), hideNotify(), and sizeChanged(..) calls to address this. Others can chime in if they know a better way.
omermuhammed