File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java Micro Edition and the fly likes Best solution 4 user-input Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Best solution 4 user-input" Watch "Best solution 4 user-input" New topic

Best solution 4 user-input

Mike Cole
Ranch Hand

Joined: Sep 25, 2006
Posts: 38
Hi all,
ive made a little game for my mobile. I have a splash screen, where i want the user to click one of the softbuttons or a number or the fire-button.
While this all works fine in the emulator, it does not on the device itself.
What would be the best solution that works on any device?
The SplashScreen extends GameCanvas...
And is switched to full screen...

Thnx in advance!
[ June 03, 2007: Message edited by: Mike Cole ]
Joao Eduardo Galli

Joined: May 02, 2007
Posts: 6
Hi Mike,

I've already made some games for fun, and some components for form use, I know what's your problem and maybe it's too hard to say that there isn't a simple solution, but I will stay with this opinion right now. My suggestion is that you can test your cellphone with a simple application, make a Canvas that prints on the screen what code you get in the method keyPressed(int code) when you press the button you want to use. Normally we use that code with the method getGameAction(int code) to get the button pressed in game defaults, but maybe this last method is not recognizing your button as a game button even if the keyPressed() method is being called.
Well, if keyPressed() is being called you can simply use the code to identify the action in the game. This problem is common because of various implementations from brand to brand or model to model in a single brand.

You can search for your phone specification or others in this next site, click on the cellphone you want an then go to the end of the page to see which buttons are recognized by Java.
I agree. Here's the link:
subject: Best solution 4 user-input
jQuery in Action, 3rd edition