allow users to switch between input languages inside a j2me java midlet keyboard qwerty E71 and such



We have a midlet that needs to allow the user to switch input languages on the fly (its a dictionary type app) between several languages (say English to Arabic etc). All was charming in the "old days" with the numeric keypad, we handled the input ourselves matching 2 clicks on the 5 to feed the correct char to our program. Then came the E71 out, it has a qwerty keyboard and in our canvas KeyPressed we get the character the user pressed, say "a" on the keyboard, now the task of matching this to the correct language (say the user is now searching for the Arabic to English side of the dictionary) involves the task of matching "a" (on the qwerty layout I guess) to the arabic letter that would come out if the layout was arabic. There is a special keyboard shortcut in these S60 devices (varies between devices) that allows the user to pop the input language selector (function + space in the case of E71) but these does not seem to work when our midlet is running. another suggested solution was to somehow use an editable textfield for the input in which case a standard support for changing the input language is offered by the jvm, however we render a canvas (a nice looking one) and replacing this with a textfield is a last resort for us.

So, the question we have is what other solution can someone think of to tackle this issue? or if anyone found a way around this annoyance? best regards, --tzurs


Posted 2009-09-28T12:56:01.337

Reputation: 110

you seem to know your domain pretty well already. Why can't you replicate the device native text input capabilities in a canvas? Or are you specifically looking for a solution that would be faster to implement? – michael aubert – 2009-09-28T17:31:32.677

you're right on the spot, i always like to get another person's view before I go ahead and spend a few hours doing something that seems very core, nothing complex here but still perhaps I've missed something obvious. – Tzur – 2009-09-28T22:08:14.380

AFAIK, most people who have faced this issue have reluctantly resorted to a GUI style break and used a Textbox or TextField. Feel free to share the code you end up writing if it works on more than one device and you are allowed. Have you checked what LWUIT does? – michael aubert – 2009-10-05T14:57:11.657

no I haven't looked at LWUIT yet, do you think they have a special trick? I don't fancy this framework so much, it seems to be very slow rendering. – Tzur – 2009-10-21T20:27:22.147

Just on the the same line though little different, How did you solve the issues with E71 such as E71 comes in QWERTY , QWERTZ layout? How do you find the current keyboard layout through J2ME – Azlam – 2009-11-16T19:51:28.443



I think you can do the mapping using the Nokia specific system properties for keypad settings. Using, and you should be able to create a generic enough solution for Nokia devices.

More info on these system properties available on Nokia docs

Gorkem Ercan

Posted 2009-09-28T12:56:01.337

Reputation: 3 120