Android-keyboard and text input

Find quick help here to get you started with Hollywood
Post Reply
tohe
Posts: 8
Joined: Wed Mar 02, 2016 10:05 am

Android-keyboard and text input

Post by tohe » Thu May 12, 2016 8:30 am

It seems that I cannot get input from Android - keyboard (I'm running 6.1 and compiled APK's).

Both:
s$ = InKeyStr(#ALPHABETICAL)
and
a$ = StringRequest(.... )

will return emptry string when running on Android (of course I also use ShowKeyboard() + HideKeyboard())

Any suggestions so I don't spend too much time implementing something that might already exists :)

PEB
Posts: 253
Joined: Sun Feb 21, 2010 1:28 am

Re: Android-keyboard and text input

Post by PEB » Fri May 13, 2016 8:13 am

You need to use InstallEventHandler() with the table field OnKeyDown (or OnKeyUp) and then keep track of what comes through msg.key.

tohe
Posts: 8
Joined: Wed Mar 02, 2016 10:05 am

Re: Android-keyboard and text input

Post by tohe » Fri May 13, 2016 8:56 am

- first thanks for answer, but as said I would rather keep things simple and as it works on other platforms I expect it to work similar way on Android too.

and update to this, incase someone else is wondering with the same issue:
- It *does* work on Android if you set up the predictive text input off and character preview off from Android settings (my devices run 4.0.4 and 5.1 Android OS and use Samsung keyboard)

User avatar
airsoftsoftwair
Posts: 3159
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Android-keyboard and text input

Post by airsoftsoftwair » Sat May 14, 2016 12:48 pm

Can you post a full script that doesn't work for you? But please make it as short as possible.

tohe
Posts: 8
Joined: Wed Mar 02, 2016 10:05 am

Re: Android-keyboard and text input

Post by tohe » Mon May 16, 2016 8:15 am

So I just tried following short clip and compiled apk:
1. it works if I have Samsung keyboard without predictive text input (and word selection bar) on
2. if I turn Samsung keyboard on with predictive text input - nothing is displayed (and s$ is empty)

same code works on any other platform + Android if you just have 'right settings for Android keyboard'.

Code: Select all

      t = GetVersion()
		If t.platform = "Android"
		ShowKeyboard()
		EndIf
		
		Locate(100, 200)
		s$ = InKeyStr(#ALPHABETICAL, 8)

		If t.platform = "Android"
			HideKeyboard()
		EndIf

User avatar
airsoftsoftwair
Posts: 3159
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Android-keyboard and text input

Post by airsoftsoftwair » Wed May 18, 2016 5:09 pm

Hmm, the problem is that I don't have any devices running the Samsung keyboard here. It is working fine on my Nexus devices with the Google keyboard. I need to see if I can borrow a Samsung device from a friend to debug this or can the Samsung keyboard be installed on Nexus devices?

tohe
Posts: 8
Joined: Wed Mar 02, 2016 10:05 am

Re: Android-keyboard and text input

Post by tohe » Wed May 18, 2016 6:51 pm

airsoftsoftwair wrote:Hmm, the problem is that I don't have any devices running the Samsung keyboard here. It is working fine on my Nexus devices with the Google keyboard. I need to see if I can borrow a Samsung device from a friend to debug this or can the Samsung keyboard be installed on Nexus devices?
I tried to download different keyboards like Swype and Swiftkey and those seem to work. So it seems that only Samsung keyboard with predictive text input is affected, just happened to be the same as I had as default :)

Post Reply