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 »

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: 567
Joined: Sun Feb 21, 2010 1:28 am

Re: Android-keyboard and text input

Post by PEB »

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 »

- 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: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Android-keyboard and text input

Post by airsoftsoftwair »

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 »

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: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Android-keyboard and text input

Post by airsoftsoftwair »

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 »

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