Getting Contents Of A Native Android Field Widget

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Googie85
Posts: 227
Joined: Tue Aug 05, 2014 10:07 am

Getting Contents Of A Native Android Field Widget

Post by Googie85 »

Hi Guys!!

I am having problems with the following code:

Code: Select all

on keyDown theKey 
   put the text of widget "ONE" into blah
   put the number of chars in blah into blah
   answer blah
end keyDown
The above code is under the "ONE" widget. What am I doing wrong??

Many Thanks,

Googie.
Last edited by Googie85 on Thu Feb 10, 2022 11:33 am, edited 1 time in total.
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Getting Contents Of A Native Android Widget

Post by richmond62 »

Dunno; this worked:

Code: Select all

on keyDown KKK
   put the text of widget "ANF" into XYZ
   put the number of chars in XYZ into ABC
   answer ABC
end keyDown
Possibly using blah all the time. :D
Googie85
Posts: 227
Joined: Tue Aug 05, 2014 10:07 am

Re: Getting Contents Of A Native Android Field Widget

Post by Googie85 »

Thanks for your reply, it didn't work.

Anyone have any more ideas??

Many Thanks,

Googie.
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Getting Contents Of A Native Android Field Widget

Post by richmond62 »

It worked on MacOS.
Googie85
Posts: 227
Joined: Tue Aug 05, 2014 10:07 am

Re: Getting Contents Of A Native Android Field Widget

Post by Googie85 »

Thanks for your help!!!!

I am using an Android Native Field. Maybe it might not work on macOS...

Thanks, Richmond!!!!
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Getting Contents Of A Native Android Field Widget

Post by Klaus »

Maybe KEYDOWN etc. do not work with Android native fields?
Unfortunately the Dictionary gives no hint.

Try the script with an "ordinary" LC text field and see if that works.
If yes, then it does not work this way with a native field.
Googie85
Posts: 227
Joined: Tue Aug 05, 2014 10:07 am

Re: Getting Contents Of A Native Android Field Widget

Post by Googie85 »

Thanks Klause!!

I was hoping to use the Native Field to disable the Auto Correct in the field. I will keep looking for a solution...

Thanks,

Googie.
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Getting Contents Of A Native Android Field Widget

Post by Klaus »

KLAUS, my name is KLAUS, no E at the end!
Googie85
Posts: 227
Joined: Tue Aug 05, 2014 10:07 am

Re: Getting Contents Of A Native Android Field Widget

Post by Googie85 »

Loser... Why be rude...
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Getting Contents Of A Native Android Field Widget

Post by Klaus »

Mimimi?

Emphasizing something with capital letters is not being rude!
And thank you for the "loser", much appreciated!
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Getting Contents Of A Native Android Field Widget

Post by richmond62 »

I tried my code with an Android native field widget
on MacOS.

What becomes clear is that development on a
desktop machine for Android is beset with
lots of traps.

Oh, Googie, as an expert at offending people,
using words like 'loser' round here will only
make you lose, no one else. So, please stop
doing that.
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Getting Contents Of A Native Android Field Widget

Post by jacque »

KeyDown isn't supported in the native Android field. Use "on textChanged" instead.

You can see all the supported commands and functions in the dictionary if you look up "Android native field".
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Getting Contents Of A Native Android Field Widget

Post by jacque »

richmond62 wrote: Thu Feb 10, 2022 2:07 pm I tried my code with an Android native field widget
on MacOS.

What becomes clear is that development on a
desktop machine for Android is beset with
lots of traps.
Native controls don't work well unless you're in the OS that supports them. You can't test an Android or iOS widget on a computer. There aren't any traps per se, just differences among operating systems.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10415
Joined: Fri Feb 19, 2010 10:17 am

Re: Getting Contents Of A Native Android Field Widget

Post by richmond62 »

Native controls don't work well unless you're in the OS that supports them.
Thank you very much for explaining that explicitly.
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Getting Contents Of A Native Android Field Widget

Post by jacque »

I suppose the only "trap" is the generic one where you have to indulge in the behavioral loop that requires a code change, a recompile, a test, repeat, over and over until you get it right. It's tedious when writing for mobile but I don't see any way around it. The instructions the engine requires are only available on the supported OS.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
Post Reply