Android: custom prop vs. .txt?
ambassador at fourthworld.com
Fri Jun 1 12:30:54 CDT 2012
Ralph DiMola wrote:
> -----Original Message-----
> Issuing a save command to the stack with the props should take
> slightly longer than writing the data to a file, but with only
> 10k the difference will be negligible.
> If you don't need to save often then using custom props will
> provide good efficiency and simple, robust behavior.
> - rg/4w
> On Android the stack is in the engine folder that is read-only.
> It resides in the apk(a zip formatted file). The engine folder
> is virtual and read only. If you want to modify a stack it needs
> to be a separate stack that you move to the documents folder.
> Any file that you want read/write must be moved from the assets
> folder to the documents folder(or SD card).
Good reminder. SD is by far the preferred option, since there's usually
much more space available there.
The restriction about saving a stack will also apply if the stack with
the properties is part of the stack file that is the executable.
My tip on the value of using stack files for data storage assumes that
the stack file has had its filename property set to an appropriate
location for writes.
Once that's done, a lot of very convenient name-value-pair programming
can be done easily and robustly using custom props in stack files.
If the nature of the data requires relationality, then a relational
database like SQLite will be essential. But for simple name-value pairs
it's hard to beat the simplicity and efficiency of custom props.
LiveCode training and consulting: http://www.fourthworld.com
Webzine for LiveCode developers: http://www.LiveCodeJournal.com
LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
More information about the use-livecode