Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Keypad keypress

 
Ashish Malik
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought this might help you
keycode
 
Ashish Malik
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18167
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ashish Malik
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sendin data via bluetooth!
 
Olga Flasza
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic