Importing text on IOS
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Importing text on IOS
I want to import a list of names from a text file I sent to DropBox to a field my Livecode app.
Livecode dictionary says:
Note: iOS imposes strict controls over what you can and cannot access. Each application in iOS is stored in its own 'sandbox' folder (referred to as the home folder). An application is free to read and write files within this folder and its descendants, but it is not allowed to access anything outside of the 'sandbox'.
It appears that I cannot copy and paste from "Pages" to my app or even import any kind of text file.
Can anyone confirm that this is true. (or has anyone found a workaround?)
Livecode dictionary says:
Note: iOS imposes strict controls over what you can and cannot access. Each application in iOS is stored in its own 'sandbox' folder (referred to as the home folder). An application is free to read and write files within this folder and its descendants, but it is not allowed to access anything outside of the 'sandbox'.
It appears that I cannot copy and paste from "Pages" to my app or even import any kind of text file.
Can anyone confirm that this is true. (or has anyone found a workaround?)
Re: Importing text on IOS
Hi
Maybe you can use the MergExt Mergdropbox to access the file directly in Dropbox and save to the local IOS folder?
See details here:
http://mergext.com/home/mergdropbox/
Roger
Maybe you can use the MergExt Mergdropbox to access the file directly in Dropbox and save to the local IOS folder?
See details here:
http://mergext.com/home/mergdropbox/
Roger
Re: Importing text on IOS
Hey, max, it's a piece of cake, and we have multiple apps that do this.
I personally use the phx_dropbox_lib because it's 100% cross-platform, but for ios only, mergDropbox works great. In either case, you use the library to grab the file, and then you have LC open it. On iOS, every application has a sandbox which includes certain folders that it can access. When you are grabbing files from dropbox, you are just depositing them in that app's sandbox.
I personally use the phx_dropbox_lib because it's 100% cross-platform, but for ios only, mergDropbox works great. In either case, you use the library to grab the file, and then you have LC open it. On iOS, every application has a sandbox which includes certain folders that it can access. When you are grabbing files from dropbox, you are just depositing them in that app's sandbox.
Re: Importing text on IOS
Thank you Mikey and Batninja. I appreciate you help.
The documentation for MergDropbox is difficult to understand, and appear to be written for more advanced programmers. It also seems to require the user to imput their account info.
All I want to do is bring a simple textfile into my App.
Here is the code I found for phx_dropbox_lib. Is this correct? If so, How do I install the library?
on mouseUp
if (the uTokenKey of this stack) is empty then
exit mouseUp
end if
put empty into field "flAnswer"
put phx_DropboxGetFileList("sandbox", , ".txt", false) into field "flAnswer"
end mouseUp
The documentation for MergDropbox is difficult to understand, and appear to be written for more advanced programmers. It also seems to require the user to imput their account info.
All I want to do is bring a simple textfile into my App.
Here is the code I found for phx_dropbox_lib. Is this correct? If so, How do I install the library?
on mouseUp
if (the uTokenKey of this stack) is empty then
exit mouseUp
end if
put empty into field "flAnswer"
put phx_DropboxGetFileList("sandbox", , ".txt", false) into field "flAnswer"
end mouseUp
Re: Importing text on IOS
Hi
Yes the notes are extensive for MergDropBox (@ http://mergext.com/home/mergdropbox/). One way of tackling this is to just get the sample livecode working then tweak the code or remove the parts that are not needed.
It sounds like you want to get files just from your own drop box?
If you do simply wish to get a text file from somewhere into your IOS app then maybe there are other ways of doing this e.g.
Sorry not to be of any further help.
Roger
Yes the notes are extensive for MergDropBox (@ http://mergext.com/home/mergdropbox/). One way of tackling this is to just get the sample livecode working then tweak the code or remove the parts that are not needed.
It sounds like you want to get files just from your own drop box?
If you do simply wish to get a text file from somewhere into your IOS app then maybe there are other ways of doing this e.g.
- get from a URL via http
get from a FTP site
use iTunes to copy across to the home folder of your app
Sorry not to be of any further help.
Roger
Re: Importing text on IOS
Both mergDropbox and phx_dropboxLib have example stacks with the packages. phx_dropboxLib is, IMHO more straightforward to get running, so for something simple, maybe that is the one to use. mergDropbox is definitely more "industrial grade".
No matter what service you use, there are authentication/token-obtaining steps that you have to perform. This is the nature of authenticated web services, unfortunately. It is still straightforward.
In neither case do you have to embed your credentials in the app. That is part of the reason why the process can be a little more complicated than just logging in.
No matter what service you use, there are authentication/token-obtaining steps that you have to perform. This is the nature of authenticated web services, unfortunately. It is still straightforward.
In neither case do you have to embed your credentials in the app. That is part of the reason why the process can be a little more complicated than just logging in.
Re: Importing text on IOS
Thank you again Roger and Mikey. I'm appreciative, but sorry to be taking your time and effort on this problem.
I am trying to assist teachers to import a class list of names into my app, so they wont have to manually retype them into the app. Perhaps by having to use authentication/token-obtaining steps for dropbox I am making the problem bigger for myself.
It just seems crazy that a user cannot copy and paste text from one app to another. We can send pictures easily to any app, but not text.
Im curious about getting from a URL via http, could this be a simple solution? Or itunes? If so, how is that done? Max
I am trying to assist teachers to import a class list of names into my app, so they wont have to manually retype them into the app. Perhaps by having to use authentication/token-obtaining steps for dropbox I am making the problem bigger for myself.
It just seems crazy that a user cannot copy and paste text from one app to another. We can send pictures easily to any app, but not text.
Im curious about getting from a URL via http, could this be a simple solution? Or itunes? If so, how is that done? Max
Re: Importing text on IOS
If you want the list of names to be secure then you have to force someone to log in to retrieve them. You can have your app do the importing, OR, the more manual way would be to have the teachers use the Dropbox app, open the file within the Dropbox app, copy the contents, then paste them into your app.
Re: Importing text on IOS
Hi Mikey
----have the teachers use the Dropbox app, open the file within the Dropbox app, copy the contents, then paste them into your app.
Yes yes yes, that is exactly what I want to do. I tried doing that but I could not get the text file to open. Perhaps I need to find the right text app to assist. I did not think I could copy and paste text from one app to another. I tried copying and pasting text from my Pages app, but nothing saved to the clipboard when I opened my livecode app.
I'll try again.
Max
----have the teachers use the Dropbox app, open the file within the Dropbox app, copy the contents, then paste them into your app.
Yes yes yes, that is exactly what I want to do. I tried doing that but I could not get the text file to open. Perhaps I need to find the right text app to assist. I did not think I could copy and paste text from one app to another. I tried copying and pasting text from my Pages app, but nothing saved to the clipboard when I opened my livecode app.
I'll try again.
Max
Re: Importing text on IOS
If you double-click the file from within the Dropbox app it should show you the contents. Save the Pages file as plain text before putting it in Dropbox.
Re: Importing text on IOS
Also, be aware of the security implications of having student info available to read in a text file that can be accessed without a password...
Re: Importing text on IOS
Hi Mikey,
It worked as you described. I was able to select and copy the text in the dropbox.
But I was unable to paste the text into Livecode.
First, I was unable to open both Livecode and any other app in split windows.
Also, there is no paste commandkey in IOS.
Also, in scripting On mouseenter --paste (or Domenu paste) -- end mouseenter does not work in IOS
Also, the dictionary says Paste does not work with IOS.
Was there a step you know about getting the copied text into Livecode? Max
It worked as you described. I was able to select and copy the text in the dropbox.
But I was unable to paste the text into Livecode.
First, I was unable to open both Livecode and any other app in split windows.
Also, there is no paste commandkey in IOS.
Also, in scripting On mouseenter --paste (or Domenu paste) -- end mouseenter does not work in IOS
Also, the dictionary says Paste does not work with IOS.
Was there a step you know about getting the copied text into Livecode? Max
Re: Importing text on IOS
Hi
Searching through the Livecode site for copy paste IOS produced several hits about how you need to use a native IOS multiline control using mobilecontrolcreate.
I have knocked up a sample stack that shows how this is done. You can paste in text into the field and then get it back out using mobilecontrolget.
Enjoy!
Roger
PS only tested on simulator
Searching through the Livecode site for copy paste IOS produced several hits about how you need to use a native IOS multiline control using mobilecontrolcreate.
I have knocked up a sample stack that shows how this is done. You can paste in text into the field and then get it back out using mobilecontrolget.
Enjoy!
Roger
PS only tested on simulator
Re: Importing text on IOS
Roger,
Thank you for doing the search in Livecode, finding the answer, and doing the extra step of making a sample stack.
It worked! That was exciting to see. It was one of the things I thought was very difficult to accomplish.
I also learned that I need to look deeper in Livecode myself for answers, as you were able to find many hits. IOS information seems to be spread in a few different places.
Thanks, Max
Thank you for doing the search in Livecode, finding the answer, and doing the extra step of making a sample stack.
It worked! That was exciting to see. It was one of the things I thought was very difficult to accomplish.
I also learned that I need to look deeper in Livecode myself for answers, as you were able to find many hits. IOS information seems to be spread in a few different places.
Thanks, Max