Page 1 of 2

Android soft keyboard

Posted: Thu Jun 16, 2011 11:51 am
by SparkOut
In the release notes it says I can configure the keyboard type with:
mobileSetKeyboardType type
Where type is one of:
• default – the normal keyboard
• alphabet – the alphabetic keyboard
• numeric / decimal – the numeric keyboard with punctuation
• number – the number pad keyboard
• phone – the phone number pad keyboard
• email – the email keyboard
Neither the simulator nor my HTC Desire Z will display a numeric keyboard. I have tried setting the type to "numeric" and to "decimal" and to "numeric / decimal" and to "number" and I still just get the standard alphabetic keyboard.
Is there a trick in the keyboard input settings on the device I need to use (I had to tweak the emulator settings to stop it showing Japanese IME input method) or is the different keyboard type not yet supported despite the Release notes entry above? Or any other guesses about what can be wrong?

Re: Android soft keyboard

Posted: Sat Jun 18, 2011 5:48 pm
by Gene
I have had the same results trying to bring up the numeric keyboard. The emulator displays a keboard that includes Japanese characters (I think this is what you referred to in your message), and my Samsung Activate delivers the regular alphanumeric keyboard when asked to show the numeric keyboard.

Now, try using the new release notes to activate the camera. The result is more emphatic on my system. It immediately crashes both the device and the emulator. I contacted RunRev Support, and there is supposed to be a bug report already on file.

I appreciate all the efforts of the RunRev staff to drive the Android development forward, but I think that perhaps some of the new Android features are ahead of their time. Personally, I think I am going to reserve my time and effort to explore the next release.

Re: Android soft keyboard

Posted: Mon Jun 20, 2011 2:56 am
by BarrySumpter
Nah. Too many cool Android features to learn.
Don't know if you've had a look at SWYPE.
And if it reacts the same way on the physical phone.
They just released a new version for android. FLEXT9.

Must research how to install FLEXT9 on the emulator.

I could have sworn it also has voice input.
But I may be getting that mixed up with Google Voice Search.

I'll be researching how to use Google Voice Search with the LiveCode Video sample.
I want to use the voice translator to record Video titles and genres, etc.
And voice commands to run, lookup etc. Sorry babbling.

Re: Android soft keyboard

Posted: Mon Jun 20, 2011 6:19 am
by BarrySumpter
Yeah trying to get the emulator to switch to FlexT9.

Can someone verify the correct code?

Code: Select all


-- Button "cmdKeyboard"

on mouseUp
   mobileSetKeyboardType "email"
end mouseUp

If this is cross platform compatible than I wonder what the iOS doco reads?

Keyboard Input
Support for basic (soft) keyboard input is provided automatically. The current Android soft
keyboard will be shown when a field is focused, and hidden again when there is no focused field.
Note: At this time, only simple keyboards that provide a one-to-one mapping between keys and
characters will function correctly. General support for Android's rich input method framework is
planned for a future release.
Configuring keyboard type
You can configure the type of keyboard that will be displayed by using the
mobileSetKeyboardType command:
mobileSetKeyboardType type
Where type is one of:
• default – the normal keyboard
• alphabet – the alphabetic keyboard
• numeric / decimal – the numeric keyboard with punctuation
• number – the number pad keyboard
• phone – the phone number pad keyboard
• email – the email keyboard
The keyboard type setting takes effect the next time the keyboard is shown – it does not affect the
currently displaying keyboard, if any.
If you wish to configure the keyboard options based on the field that is being focused, simply use
the commands in an openField handler of the given field. The keyboard is only shown after this
handler returns, so it is the ideal time to configure it.
Cross-Mobile Note: You can use the same command to configure the keyboard on both Android and
iOS.

Re: Android soft keyboard

Posted: Mon Jun 20, 2011 5:05 pm
by jacque
Try setting the keyboard type in an openField handler. The docs seem to indicate this is the expected way. It's pretty new stuff, so experimentation will probably be in order.

Re: Android soft keyboard

Posted: Mon Jun 20, 2011 7:30 pm
by SparkOut
Well as far as my original question goes, the setting of the keyboard type is done in an on openField handler (as per the release notes suggestion). I'm beginning to wonder whether the "numeric / decimal" keyboard type etc an iOS only feature, and this is a case of copy/pasting too much in the release notes. I could be wrong but

Code: Select all

on openField
   if the environment is "mobile" then
      mobileSetKeyboardType "numeric / decimal"
   end if
end openField
looks ok as code to me, and it works but only presenting the standard alphabetic keyboard.

Re: Android soft keyboard

Posted: Mon Jun 20, 2011 8:12 pm
by jacque
I wouldn't be surprised if there were a bug in there. I'd say report it. It probably does work on the devices RR has on hand, but they've found discrepancies in other commands when tested on devices they don't have. This could be one of those situations. Or maybe it's just a flat-out regular old bug. Your code looks fine to me.

Re: Android soft keyboard

Posted: Mon Jun 20, 2011 8:32 pm
by SparkOut
Yes, bugged it. http://quality.runrev.com/show_bug.cgi?id=9594

It's actually giving a crash on both my device and in the emulator if I try any other keyboard type than "alphabet" or "numeric / decimal".

Re: Android soft keyboard

Posted: Mon Jun 20, 2011 9:55 pm
by BarrySumpter
Those instctions on the right in the text field are tap/click/touch instuctions.

As I know the Default Keyboard will always work.
So you know if you tap the Default Keyboard and then the Numeric/Decimal.
Then tap the text Field that
if the Number/Decimal works then it will display the Number/Decimal keyboard
otherwise if the Number/Decimal dosen't work then the default keyboard will show.

hth

And whats up with the Option menu comtrol on Android?

Re: Android soft keyboard

Posted: Tue Jun 21, 2011 12:37 am
by SparkOut
Thanks for that Barry, I'm afraid it still doesn't work for me, I get a crash on most options and a standard alphabet keyboard on the ones that don't crash. (Only the default and numeric / decimal won't give a crash.)
I am wondering now if my Android version 2.2 is the problem? My emulator is set to match this as the target level. I will try tomorrow when I have a spare hour or two to wait for a new emulator image of higher version to be constructed :roll:

Re: Android soft keyboard

Posted: Tue Jun 21, 2011 12:57 am
by BarrySumpter
hmmm, On my hd2

Neither the numeric/decimal nor the numeric / decimal work.
(I think this is just an interpretation misunderstanding.
its either "numeric" or "decimal" and NOT "numeric / decimal")

Nor EMail


Default and Alphabet work

All three numeric and decimal and number work.
And Phone


I'm thinking they might be there in Android Froya 2.2
but not implemented completely by LiveCode for Android as yet.

I wonder if its case sensitive?

Anyone know the keywords for the keyboards on iOS?

Re: Android soft keyboard

Posted: Tue Jun 21, 2011 1:06 am
by SparkOut
"numeric / decimal" doesn't give me a crash, but just gives me the default keyboard.
"numeric" crashes it
"decimal" crashes it
"phone" crashes it
"number" crashes it
"email" crashes it

I have downloaded your stack and ... it crashes. It doesn't crash until the focus moves to the target text field and as soon as it tries to display the keyboard, it vanishes. The whole app, I mean.

Re: Android soft keyboard

Posted: Tue Jun 21, 2011 1:09 am
by BarrySumpter
Testing on the emulator or the physical phone?
What emulator and what phone?

I'm running Android Froya 2.2 on both. All OK. Certainly no crashing.

Do you have debug mode ticked ON?

Also, I've installed FlexT9 - and it gives me a special phone keyboard.


I wonder if there is one of those special commands to show/enumerate keyboards in the display box.

Re: Android soft keyboard

Posted: Sat Jun 25, 2011 8:54 am
by SparkOut
This is on both the emulator and physical device.
I just tried again with LC 4.6.2 to see if it was a version glitch, but it still crashes if I try to choose anything other than a default alphabetic or numeric keyboard, and the numeric keyboard only gives me the default alphabetic version still.

Re: Android soft keyboard

Posted: Sat Jun 25, 2011 9:36 am
by BarrySumpter
Android drew the short straw on any significant updates on this release.

For the only thing of note was not having to restart LC when I select a different emulator.