Page 1 of 1

android emulator not accepting keyboard input

Posted: Sun Sep 29, 2013 5:25 pm
by garyth123
Hi,

I am having some problems deploying to the Android platform, specifically testing an app on the emulator.

The chief of these is that the emulator is not accepting input from the keyboard and there is no virtual keyboard shown on the emulator. The emulator will accept mouse clicks however. The attached screenshot shows my emulator after I have clicked the button. The text entry field in the background (a LC scrolling field) will not accept any input although the cursor is blinking in the field.

In the app which I am hoping to develop the user will need to enter a user id and a password. However because of the above problem I cannot enter these and so test whether the app is logging in correctly.

I have tried googling for a solution to this but so far have not found it.

Does anyone have any ideas as to what I can do?

Re: android emulator not accepting keyboard input

Posted: Sun Sep 29, 2013 6:19 pm
by bangkok
Yes.

Better to create a native control.

Code: Select all

on opencard
      put "input" into tControlType
      mobileControlCreate tControlType, "itmref"
      mobileControlSet "itmref", "visible", true 
      mobileControlSet "itmref", "rect", "20,150,300,220"
      mobileControlSet "itmref", "keyboardType", "alphabet"
      mobileControlSet "itmref", "autoCorrectionType", "no"
end opencard
The virtual keyboard will appear when you click in this field.

Re: android emulator not accepting keyboard input

Posted: Mon Sep 30, 2013 12:05 pm
by garyth123
Thanks for the code and pointer to the handlers I need to use for this. However I'm finding that the control is not appearing in the emulator. Is there something else that I need to do to get it to show. I have placed the code in a preOpenCard handler in the card script.

Are there any runrev lessons on using mobilecontrols, and specifically on Android?

Re: android emulator not accepting keyboard input

Posted: Mon Sep 30, 2013 12:35 pm
by LCNeil
Hi Garyth123,

As bangkok has suggested, you will need to create a native input control in your app to accept text input from hardware keyboard.

I have tested bangkoks script and it works when placed in the openCard handler so I would suggests moving it to there.

The following tutorial is from our lesson portal and it explains how to use native mobile controls in detail.

http://lessons.runrev.com/s/lessons/m/4 ... -on-mobile

Kind Regards,

Neil Roger

--
RunRev Support Team ~ http://www.runrev.com
--

Re: android emulator not accepting keyboard input

Posted: Mon Sep 30, 2013 1:02 pm
by garyth123
Hi Neil,

I don't know what I did wrong other than put the code in a preOpenCard handler but on retrying it in the openCard handler have found the code works.

Thanks to you both.

Gary