Getting input in Android

Monkey Targets Forums/Android/Getting input in Android

Shinkiro1(Posted 2011) [#1]
How would you bring up the standard keyboard and then get the input?
I hope you don't have to code one yourself?


Supertino(Posted 2011) [#2]
Well on the emulator I gave it a quick go but the andriod app would not accept commands from the keyboard eg, KeyHit(KEY_A) etc.

TBH I would rather code a simple onscreen keyboard to maintain the look of the game(s)... atleast for entering player names and highscores.

But I guess I am rambling and have not answered your question =D


Shinkiro1(Posted 2011) [#3]
I know monkey is not suited for apps but games, still I want to make an app where I need to get input from the user.
Then maybe i'll just code a keyboard myself.

Also: Any way to make my app more like an app (native elements like textfields) and not going full screen.


Volker(Posted 2011) [#4]
I've just tested it on a handy with keyboard. KeyHit(KEY_1) is not working properly.


Canardian(Posted 2011) [#5]
I tested it with Android emulator, and KeyDown(KEY_A) is not working either. Yes, I added the keyboard support to the emu file.


Shinkiro1(Posted 2011) [#6]
Thanks for testing @Supertino and Volker

PS: @Volker: You wanted to write mobile phone, right? ^^


BigAnd(Posted 2011) [#7]
I did a quick test with this bit of code:
for i=0 to 255
	if KeyDown(i)
		//Draw Thumbs Up!! :)
	End
Next

The only thing it reacted to was a touch on the screen. This was in the emulator with a keyboard enabled and also on my Desire.


Volker(Posted 2011) [#8]
PS: @Volker: You wanted to write mobile phone, right? ^^

Yes, of course :-)