aspose file tools*
The moose likes Java Micro Edition and the fly likes Keypad keypress Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Keypad keypress" Watch "Keypad keypress" New topic
Author

Keypad keypress

Ashish Malik
Ranch Hand

Joined: Jul 11, 2010
Posts: 50
I have build a j2me app that sends the data to some device regularily like every 50ms.
I want it to respond to keypress on keypad of mobile phone and sent a particular data for each key! How to do that?
Olga Flasza
Greenhorn

Joined: Mar 26, 2010
Posts: 28
I thought this might help you
keycode
Ashish Malik
Ranch Hand

Joined: Jul 11, 2010
Posts: 50
Thanks but i already had a look at this.
But i couldnt figure out actualy which interfaces need to be implemented? And whats the deal about "keyPress()" function? Does it come from Canvas class?
And is this function the one called when a key is Pressed?
Olga Flasza
Greenhorn

Joined: Mar 26, 2010
Posts: 28
Yes the Canvas class provides three callback method keyPress(), keyReleased() and keyRepeated(). As the name suggest they are called when you do something with the key. As far as I understand, the Board class need to implement CommandListener interface because it included a exit command. The must have method for CommandListener class is commandAction() method, So you need to exclusively define this method in the Board Class which extends Canvas class and implements the CommandListener Interface.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16065
    
  21

How do you plan to send the data? If you use an Internet connection over the carrier's network it will probably take a LOT longer than 50ms just to send a single event.


Customer surveys are for companies who didn't pay proper attention to begin with.
Ashish Malik
Ranch Hand

Joined: Jul 11, 2010
Posts: 50
I am sendin data via bluetooth!
Olga Flasza
Greenhorn

Joined: Mar 26, 2010
Posts: 28
Hi, glad to know that! Hope you are also receiving those data successfully ;) I am also a newbie.. can you please put here some code of yours so that I understand. many thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Keypad keypress