open remote file in iOS
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
open remote file in iOS
I'm a working on a vocabulary game for my students. I have it set right now that vocabulary lists are stored as the CSV contents of fields on a "secret" card. The player selects a list from a menu button, that list's field is "loaded" into the game, and play commences. OK, it works, but as my curriculum changes, it would be much easier to change the vocabulary files on a webpage rather than having to update the app; moreover, I could develop other games which call the same CSV lists.
So, the question is: in an iOS app, is it possible for the player to select from a list of files stored on a webpage and load a CSV file from the webpage?
1) Is it possible?
2) If so, any hints on execution?
Thanks!
So, the question is: in an iOS app, is it possible for the player to select from a list of files stored on a webpage and load a CSV file from the webpage?
1) Is it possible?
2) If so, any hints on execution?
Thanks!
-
- VIP Livecode Opensource Backer
- Posts: 10048
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: open remote file in iOS
It's technically easy to do in LiveCode:
go url "http://www.domain.com/folder/mystack.rev"
You can even shorten download time by using LC's built-in compression.
But that said, I believe the iOS developer agreement prohibits downloading code modules from iOS apps. Not sure how that plays out in your specific scenario, but you may want to review Apple's guidelines before architecting for this.
go url "http://www.domain.com/folder/mystack.rev"
You can even shorten download time by using LC's built-in compression.
But that said, I believe the iOS developer agreement prohibits downloading code modules from iOS apps. Not sure how that plays out in your specific scenario, but you may want to review Apple's guidelines before architecting for this.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: open remote file in iOS
Thanks for the reply, but I think you misunderstood. I don't want to show a webpage, nor do I want to download an actual code module. I basically want to read (only) information in a text file stored elsewhere. (A comma-separated-value text file.)
I know that other iOS apps access files stored online all the time, and the information stored within them, I just don't know if it's possible through LiveCode.
Basically, I guess I'm asking if I'll be able to do something like this:
but with the txt file residing somewhere online instead of on the iPod.
Hmmm... As I write this, it really seems like a, "Well of course you can!" question; I guess just want to make sure before I begin pulling my hair out.
Thanks again.
I know that other iOS apps access files stored online all the time, and the information stored within them, I just don't know if it's possible through LiveCode.
Basically, I guess I'm asking if I'll be able to do something like this:
Code: Select all
on mouseUp
set the defaultFolder to specialFolderPath("Documents")
put URL ("file:iphonetest.txt") into field "read"
end mouseUp
Hmmm... As I write this, it really seems like a, "Well of course you can!" question; I guess just want to make sure before I begin pulling my hair out.

Thanks again.
Re: open remote file in iOS
Hi whiteowl,
do this:
Best
Klaus
do this:
Code: Select all
on mouseUp
put URL ("http://www.yordomain.com/folder1/folder1/your_text_file.txt") into field "read"
## When no error occurs, THE RESULT is empty,
## otherwise contains a string describing the problem
if the result <> empty then
answer "There was an error loading the document!" & CR & the result
end if
end mouseUp
Klaus
Re: open remote file in iOS
Thanks, Klaus. That looks like a good way to test before writing too much code. 

Re: open remote file in iOS
Hmmm... Well, this is weird.
I created a "test" button using the code given by Klaus, edited for the file and field. It works without error in LC, but does absolutely nothing in the simulator. No error, no text in the field, no nothing. Just... nothing.
I can use Safari in the simulator, type the address of the file into the address bar, and Safari loads the list, in case that matters. It's just the LC standalone that doesn't seem to...
Ideas? Thoughts? Alternate solutions?
I created a "test" button using the code given by Klaus, edited for the file and field. It works without error in LC, but does absolutely nothing in the simulator. No error, no text in the field, no nothing. Just... nothing.
I can use Safari in the simulator, type the address of the file into the address bar, and Safari loads the list, in case that matters. It's just the LC standalone that doesn't seem to...
Ideas? Thoughts? Alternate solutions?