IOS Deployment -- Lots of questions!

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
mluka
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 73
Joined: Sun Jun 17, 2007 12:08 am
Location: Montréal, Canada

IOS Deployment -- Lots of questions!

Post by mluka » Mon Jun 18, 2018 10:22 pm

Hi all.

I’m going to write a few apps for deployment on my iPhone (iPhone X). Most likely never to the Apple App store. Just for personal use.

I’m using an iMac, OS X 10.12.6, LC 9.0.0 Community.

For the past couple of weeks, I’ve been going through the user manual. All of it.

Also lurking and reading posts on the forums.

I’ve come to realize a few things. (Please correct me where my understanding is wrong!)
  1. A LC IOS app is, by definition, a standalone. Right?
  2. A standalone cannot “self-modify”; in other words, you can not input (or save only?) new data into it. (When you re-launch the app, it will be in the same, previous, original state.) Right?
  3. Except there are two ways to get around this: 1- Use the “Splash Stack” approach. (BTW I first learned about splash stack in reading up on the DataGrid upon which I’ll rely heavily for my apps). One thing is not clear: does this approach really mean that data (in the “main stack”, not the “splash stack”) can be updated, added to, edited, deleted, saved, etc, etc???
  4. The other approach (which is much more intuitive to me) is to store the data in “external” files. Well, certainly, on OS X, that’s clear. There is lots of information (in the LC docs and site, lessons, etc.) on how to do this, which commands to use, etc. Right.
  5. But what about IOS??? How is data structured under IOS? In LC, do I use the same commands (as for OS X)? Such as “Open file “ABC” for write”, for example? By accident, I stumbled upon the Dictionary entry for “specialFolderPath”: there is a bit of information there about the IOS file system; but very limited. The User Guide has a section entitled “File Types, Application Signatures & File Ownership” with four sub-sections: Windows, OS X, Mac OS X Classic and Linux. Not a word on IOS (or Android)! Question: what is the best source of information for this? Apple?
  6. In this day and age, I would have thought that a logical place to keep “external” files would be on the iCloud Drive (if in the IOS environment). There is not a single reference to iCloud in the User Guide. I’m not looking in the right place, right? Where should I be looking for this?
  7. I was very surprised to find that the User Guide does NOT contain a section entitled “LC and IOS” (or Android, for that matter). Is there another manual that I don’t know about??? I have very basic questions in my mind; for instance: on my iPhone, buttons behave differently (in some apps) when they’re “tapped” and when they’re “pressed”. How is this handled in LC??? I searched the Dictionary for “press” but got nowhere.
  8. Another question, very basic, I’m sure: in the 9.0.0 IDE, when creating a new stack, there is no option for a size of “iPhone X”. (Or 7 or 8, for that matter). How important is this??? Is it OK if I create a stack at the default size and then resize it myself? Am I missing something by not picking one of the specific sizes???
In a way I feel sorry to be asking all these basic questions… Thanks in advance for your help!
Michel
Montréal, Canada

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: IOS Deployment -- Lots of questions!

Post by jacque » Tue Jun 19, 2018 10:16 pm

A LC IOS app is, by definition, a standalone. Right?
That's right.
A standalone cannot “self-modify”; in other words, you can not input (or save only?) new data into it. (When you re-launch the app, it will be in the same, previous, original state.) Right?
You can input or change anything, but it will never be saved. This lets you collect info if you need to, but you'll need to write it to disk separately from the standalone.
Except there are two ways to get around this: 1- Use the “Splash Stack” approach. (BTW I first learned about splash stack in reading up on the DataGrid upon which I’ll rely heavily for my apps). One thing is not clear: does this approach really mean that data (in the “main stack”, not the “splash stack”) can be updated, added to, edited, deleted, saved, etc, etc???
Yes, because the data stack is opened independently and isn't part of the standalone. Data stacks can be saved normally to disk. However, the data stack has to be copied to a writeable location first; this is usually the documents folder on mobile, or the application support folder on desktop (that's for Mac, there's an equivalent for Windows.)
The other approach (which is much more intuitive to me) is to store the data in “external” files. Well, certainly, on OS X, that’s clear. There is lots of information (in the LC docs and site, lessons, etc.) on how to do this, which commands to use, etc. Right.
This is the same as saving a data stack, the only difference being that the external file is in a different file format. If all you need is a text file, that can sometimes be easier to wrap your head around but it's still basically just saving a file to disk.
But what about IOS??? How is data structured under IOS? In LC, do I use the same commands (as for OS X)? Such as “Open file “ABC” for write”, for example? By accident, I stumbled upon the Dictionary entry for “specialFolderPath”: there is a bit of information there about the IOS file system; but very limited. The User Guide has a section entitled “File Types, Application Signatures & File Ownership” with four sub-sections: Windows, OS X, Mac OS X Classic and Linux. Not a word on IOS (or Android)! Question: what is the best source of information for this? Apple?

SpecialFolderPath() is what you need on any platform or OS. For mobile, save to specialFolderPath("documents") because that is a reliable, writeable location. It's often used on desktop too, though there are other folders that allow user files to be saved on those platforms. Each desktop OS has a preferred location for saving data, preferences, and that sort of thing. But documents is always reliable everywhere. (Some users, like me, don't like all kinds of random stuff in Documents so I try not to do that to anyone else.)

You can use the same commands to open, read, or write to the file on any platform.
In this day and age, I would have thought that a logical place to keep “external” files would be on the iCloud Drive (if in the IOS environment). There is not a single reference to iCloud in the User Guide. I’m not looking in the right place, right? Where should I be looking for this?
Sorry, no idea, but it likely would involve a special interface much as using Dropbox does.
I was very surprised to find that the User Guide does NOT contain a section entitled “LC and IOS” (or Android, for that matter). Is there another manual that I don’t know about??? I have very basic questions in my mind; for instance: on my iPhone, buttons behave differently (in some apps) when they’re “tapped” and when they’re “pressed”. How is this handled in LC??? I searched the Dictionary for “press” but got nowhere.
You'll need to script this, usually based on a time interval. Save the milliseconds on mouseDown, and compare that with the milliseconds on mouseUp to determine if it is a long press or a tap. When you get that far, ask if you have questions.
Another question, very basic, I’m sure: in the 9.0.0 IDE, when creating a new stack, there is no option for a size of “iPhone X”. (Or 7 or 8, for that matter). How important is this??? Is it OK if I create a stack at the default size and then resize it myself? Am I missing something by not picking one of the specific sizes???
This is a UI problem we've discussed before, and some of us think it was a mistake to put that list into the menu. It gives the impression there is something special about those sizes (and where are any Android sizes?) but really they are just quick ways to create a stack of a certain size for a few different devices. It's no different than sizing the stack yourself so feel free.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

mluka
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 73
Joined: Sun Jun 17, 2007 12:08 am
Location: Montréal, Canada

Re: IOS Deployment -- Lots of questions!

Post by mluka » Wed Jun 20, 2018 4:02 am

Jacqueline, thank you very much for taking the time to answer my l-o-n-g list of basic questions. You've made several things much clearer. Thank you!
Michel
Montréal, Canada

Post Reply

Return to “iOS Deployment”