Page 1 of 1

Can't copy to Android clipboard

Posted: Sat May 02, 2020 1:12 am
by MarcusF
I'm trying to copy text from a field into the Android clipboard but the program just stops at that point.

I've tried

Code: Select all

   select the text of field "Final Text"
   copy the selectedText of field "Final Text"
   answer "Text copied"
Doesn't get to the answer part.

I've also tried

Code: Select all

   select the text of field "Final Text"
   set the clipboardData["text"] to the text of field "Final Text"
   answer "Text copied"
It also stops before getting to the answer part.

Am I doing something wrong? Do I need any particular setting?

I'm testing on a real device via USB tether, target set to Android 8

Re: Can't copy to Android clipboard

Posted: Sat May 02, 2020 12:10 pm
by Klaus
Hi MarcusF,

clipboard, clipboarddata etc. is NOT supported on the mobile platform!
If in doubt, always check the dictionary, it will list the supported platforms for a command/function.


Best

Klaus

Re: Can't copy to Android clipboard

Posted: Sat May 02, 2020 4:35 pm
by FourthWorld
LiveCode's built-in field object have not yet been expanded to integrate with mobile OSes as it does on desktop platforms.

In addition to clipboard support, you'd eventually discover other shortcomings using those on mobile, including nonstandard UI for text selection.

LiveCode does offer support for mobile-native fields, however, using the script interface described in the User Guide and this lesson:
http://lessons.livecode.com/m/4069/l/29 ... -on-mobile

Re: Can't copy to Android clipboard

Posted: Sat May 02, 2020 8:19 pm
by MarcusF
Right, so that's sorted by using a native input, and letting the OS deal with text and copying.

That feels like quite an awkward solution for a paid license of a product with heavy focus on mobile development, but it did solve the problem at hand, thanks for the info FourthWorld