Can't copy to Android clipboard

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

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
MarcusF
Posts: 5
Joined: Sat May 02, 2020 1:03 am

Can't copy to Android clipboard

Post by MarcusF » Sat May 02, 2020 1:12 am

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

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

Re: Can't copy to Android clipboard

Post by Klaus » Sat May 02, 2020 12:10 pm

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8474
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Can't copy to Android clipboard

Post by FourthWorld » Sat May 02, 2020 4:35 pm

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
Richard Gaskin
LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

MarcusF
Posts: 5
Joined: Sat May 02, 2020 1:03 am

Re: Can't copy to Android clipboard

Post by MarcusF » Sat May 02, 2020 8:19 pm

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

Post Reply

Return to “Android Deployment”