android emulator not accepting keyboard input

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Locked
garyth123
Posts: 88
Joined: Sat Apr 27, 2013 11:14 am
Location: Edinburgh, Scotland
Contact:

android emulator not accepting keyboard input

Post by garyth123 » Sun Sep 29, 2013 5:25 pm

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?
Attachments
androidss.png

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: android emulator not accepting keyboard input

Post by bangkok » Sun Sep 29, 2013 6:19 pm

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.

garyth123
Posts: 88
Joined: Sat Apr 27, 2013 11:14 am
Location: Edinburgh, Scotland
Contact:

Re: android emulator not accepting keyboard input

Post by garyth123 » Mon Sep 30, 2013 12:05 pm

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?

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: android emulator not accepting keyboard input

Post by LCNeil » Mon Sep 30, 2013 12:35 pm

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
--

garyth123
Posts: 88
Joined: Sat Apr 27, 2013 11:14 am
Location: Edinburgh, Scotland
Contact:

Re: android emulator not accepting keyboard input

Post by garyth123 » Mon Sep 30, 2013 1:02 pm

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

Locked

Return to “Summer School 2013”