• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Keypad keypress

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought this might help you
keycode
 
Ashish Malik
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am sendin data via bluetooth!
 
Olga Flasza
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic