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: 199
Joined: Tue Aug 05, 2014 10:07 am

Getting Contents Of A Native Android Field Widget

Post by Googie85 » Thu Feb 10, 2022 11:15 am

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: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Getting Contents Of A Native Android Widget

Post by richmond62 » Thu Feb 10, 2022 11:24 am

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: 199
Joined: Tue Aug 05, 2014 10:07 am

Re: Getting Contents Of A Native Android Field Widget

Post by Googie85 » Thu Feb 10, 2022 11:34 am

Thanks for your reply, it didn't work.

Anyone have any more ideas??

Many Thanks,

Googie.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Getting Contents Of A Native Android Field Widget

Post by richmond62 » Thu Feb 10, 2022 11:38 am

It worked on MacOS.

Googie85
Posts: 199
Joined: Tue Aug 05, 2014 10:07 am

Re: Getting Contents Of A Native Android Field Widget

Post by Googie85 » Thu Feb 10, 2022 11:46 am

Thanks for your help!!!!

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

Thanks, Richmond!!!!

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Getting Contents Of A Native Android Field Widget

Post by Klaus » Thu Feb 10, 2022 12:09 pm

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: 199
Joined: Tue Aug 05, 2014 10:07 am

Re: Getting Contents Of A Native Android Field Widget

Post by Googie85 » Thu Feb 10, 2022 12:13 pm

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: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Getting Contents Of A Native Android Field Widget

Post by Klaus » Thu Feb 10, 2022 12:32 pm

KLAUS, my name is KLAUS, no E at the end!

Googie85
Posts: 199
Joined: Tue Aug 05, 2014 10:07 am

Re: Getting Contents Of A Native Android Field Widget

Post by Googie85 » Thu Feb 10, 2022 12:33 pm

Loser... Why be rude...

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Getting Contents Of A Native Android Field Widget

Post by Klaus » Thu Feb 10, 2022 12:44 pm

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: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Getting Contents Of A Native Android Field Widget

Post by richmond62 » 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.

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: 7214
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Getting Contents Of A Native Android Field Widget

Post by jacque » Thu Feb 10, 2022 7:16 pm

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: 7214
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Getting Contents Of A Native Android Field Widget

Post by jacque » Thu Feb 10, 2022 7:23 pm

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: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Getting Contents Of A Native Android Field Widget

Post by richmond62 » Thu Feb 10, 2022 8:11 pm

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: 7214
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Getting Contents Of A Native Android Field Widget

Post by jacque » Fri Feb 11, 2022 7:44 pm

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

Return to “Android Deployment”