Clipboard functionality for iOS and Android?

Moderators: LCNeil, heatherlaine, kevinmiller, elanorb

Post Reply
nower
Posts: 47
Joined: Wed May 22, 2013 11:02 pm

Clipboard functionality for iOS and Android?

Post by nower » Tue Mar 18, 2014 1:28 pm

My desktop app supports copying and pasting text to and from the clipboard on a couple of cards.
According to the mobile documentation and the dictionary for 6.5.2 this does not seem to be supported on mobile, both for iOS and Android.

Can you confirm this?

If it is true, is that planned to change, and if so, when? Clipboard support seems pretty essential functionality for me in any environment.
How do you recommend to deal with it?

Thank you,
Werner

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Clipboard functionality for iOS and Android?

Post by LCNeil » Tue Mar 18, 2014 2:08 pm

Hi Werner,

There is no clipboard functionality for LiveCode fields when running your application on a mobile device. If you want to copy and past text between fields then you will need to implement a native mobile text control. The following lesson explain how to do so-

http://lessons.runrev.com/s/lessons/m/4 ... -on-mobile

Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com

nower
Posts: 47
Joined: Wed May 22, 2013 11:02 pm

Re: Clipboard functionality for iOS and Android?

Post by nower » Wed Mar 19, 2014 3:09 am

Hi Neil,

thank you for your response.
Unfortunately it it not very satisfying.

Runrev heavily promotes the cross-platform development capabilities of LiveCode. This promise got me started with LiveCode.
However, if such an essential feature as copy-and-paste is missing from cross-platform fields, you basically have to implement separate user interfaces for different environments. That seriously impacts the promise of cross-platform development.

Is this functionality on the road map as a future enhancement, or does Runrev not have plans to make cross-platform development between computers and mobile environments as smooth as possible? If the latter is the case, that should be clearly communicated to not set wrong expectations.
It's kind of odd that such a small feature has such significant implications.

Best,
Werner

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Clipboard functionality for iOS and Android?

Post by LCNeil » Wed Mar 19, 2014 1:33 pm

Hi Werner,

The copy and paste functionality is something that we are aware that our user are interested in but it is unfortunately a limitation of the current LiveCode field when deployed on mobile.

Completing the current elements on the LiveCode roadmaps, more specifically the syntax refactoring, will allow implementation of such features far easier. You can see a list of the current items we are working on here-

http://livecode.com/community/roadmap

The method of using native mobile fields is what users generally use if they want copy/paste functionally for fields on mobile. The other benefit of using native fields is that they allow for other native field specific features (e.g. auto correct)

There is a workaround if you wish to implement a copy and past functionality for LiveCode fields on mobile and it entails using variables and the focusedObject. Please see the attached stack as an example
copypastemobile.livecode.zip
(1.98 KiB) Downloaded 123 times
I hope this is of some assistance

Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——

nower
Posts: 47
Joined: Wed May 22, 2013 11:02 pm

Re: Clipboard functionality for iOS and Android?

Post by nower » Wed Mar 19, 2014 3:11 pm

Thank you, Neil, I will check it out.

Werner

nower
Posts: 47
Joined: Wed May 22, 2013 11:02 pm

Re: Clipboard functionality for iOS and Android?

Post by nower » Fri Mar 21, 2014 4:45 am

I looked into it a bit more, and the workaround only seems to work for copy-and-paste between LC fields, but not between other apps and an LC app.

Is there some kind of workaround that would at least allow me to place the text from a LC field onto the mobile clipboard?
E.g. copying the text to a hidden native field, selecting it, and then triggering a copy command. The first two part of this look very feasible, so it seems to hang on being able to trigger a copy action for the native field. Is that possible from within LC?

Thank you,
Werner

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Clipboard functionality for iOS and Android?

Post by LCNeil » Fri Mar 21, 2014 11:17 am

Hi Werner,

Yes, my example would be if you were to keep copy and paste within the context of your LiveCode application. Unfortunately, there are no direct commands that will allow you active a copy command from hidden native field so a the suggested workaround would not be possible.

With that being said, I have found an external that one of our users created that allows you to copy the text from a LiveCode field to the mobile clipboard. More information on this can be found here-

http://forums.runrev.com/viewtopic.php?f=49&t=15767

I have built and tested this against the 7.0 simulator and it works great.

Please see the below screen capture that show this working

http://techsupport.on-rev.com/werner.mp4.zip

The only downside to this method is that externals are not yet available for Android

If you have any issues building the external, please let us know and we will make a version of the external available

I hope this gives you some leads.

Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——

nower
Posts: 47
Joined: Wed May 22, 2013 11:02 pm

Re: Clipboard functionality for iOS and Android?

Post by nower » Mon Mar 24, 2014 2:36 am

Thank you for the follow-up, Neil.

It looks good on iOS. I would like to have my app work both on iOS and Android, and writing an Android external for it is beyond my scope at this time.
Seems I have to put this part of the app on the back burner for now - hopefully the functionality will become available in LC itself at some point.

Just a general follow-up question on this:
For PC environments LC (just as many other programming environments) allows to send a native command to the host system for execution. Do I understand correctly that something like this is not possible on mobile platforms?
Do you know why? Is the architecture so different?

Thanks,
Werner

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Clipboard functionality for iOS and Android?

Post by LCNeil » Mon Mar 24, 2014 2:27 pm

Hi Werner,

Do you have an example of a native command that you would be looking to execute? As we may have an in-built LiveCode function or command available for it.

It is possible to use shell to execute a command and then return its output but this is limited to the desktop environment.

Im not sure of how readily available such functionality is on mobile devices as, in the case of iOS, I believe Jailbreaking your device is required for low level command line access to the device-

http://www.iphonefaq.org/archives/971616
http://stackoverflow.com/questions/1568 ... and-output

The main reason for the introduction of externals was to allow you to add the additional mobile functionally that you require that is not currently present directly within LiveCode

Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——

nower
Posts: 47
Joined: Wed May 22, 2013 11:02 pm

Re: Clipboard functionality for iOS and Android?

Post by nower » Tue Mar 25, 2014 12:49 am

Hi Neil,

thank you for the explanation.

I didn't have a specific command in mind. There was just the idea that native commands might allow you to do a copy or paste in native, so I was curious about the general idea. I understand that security is often tighter in mobile environments.
I am more familiar with desktop and server environments where such functionality is common.

Werner

Post Reply

Return to “idea2app and Coding School”