I thought it was on this forum but may have been elsewhere...
Android Note:
An Android application is installed on the phone in the form of its zip package. This means that any assets that are included are not available as discrete files in the native filesystem. In order to manage this the engine essentially 'virtualizes' the asset files you include, allowing (read-only) manipulation with all the standard LiveCode file and folder handling syntax. To access the assets you have included within your application, use filenames relative to specialFolderPath ("engine").
For Android systems:
• engine - The (virtual) path to the engine and its assets.
• documents - The path to a folder that can be used for per-application data files.
• cache - The path to a folder that can be used for transient per-application data files.
Value:
The specialFolderPath function returns a folder name and location.
I'm trying to get organized with lots of .txt files.
defaultAppFOlder = c:\BarrysApp
I can write to BarrysCatagory folder (already created) and File:
BarrysCaragory\BarrysCatagory-2011-08-24 1840.txt
I name the file this way so I can move file anywhere without worrying about the folder name.
its the same as:
Code: Select all
....
put MyDGColumnNames & CR & MyDGText into url "BarrysCaragory\BarrysCatagory-2011-08-24 1840.txt"
....
Working in Windows:
Code: Select all
....
Put the label of this stack into theFolderName
Put theFolderName & "\" & theFolderName & " - " & theFileName into theFolderAndFileName
put "file:" before theFolderAndFileName
put MyDGColumnNames & CR & MyDGText into url theFolderAndFileName
....
Blast! Just had a flash something about special folder engine being executable/read only.
And we should use the documents folder on Android.
I'm sure that was on this forum but can't seem to find the thread.
if the environment is "mobile" then
If the platform is "android" then
put the platform into tPlat
switch tPlat
case "MacOS"
case "Win32"
## Desktop
start player "player
break
case "mobile"
## do your mobile stuff here
break
### etc...
Code: Select all
if the ENVIRONMENT is "mobile" then
-- ENVIRONMENT - development, standalone application, helper application, browser, mobile
If the PLATFORM is "android" then -- PLATFORM - MacOS, Win32, android, etc.
Put the label of this stack into theSubFolderName
put SPECIALFOLDERPATH("documents") & "\" & theSubFolderName INTO theFolderName
if there is NOT a FOLDER theFolderName then
CREATE FOLDER theFolderName
end if
Put theFolderName & "\" & theFolderSubName & " - " & theFileName INTO theFolderAndFileName
put "file:" BEFORE theFolderAndFileName
put MyDGColumnNames & CR & MyDGText into URL theFolderAndFileName
end if
end if
if the ENVIRONMENT is "standalone application" or the ENVIRONMENT is "development" then
-- ENVIRONMENT - development, standalone application, helper application, browser, mobile
If the PLATFORM is "win32" then -- PLATFORM - MacOS, Win32, android, etc.
Put the label of this stack into theFolderName
Put theFolderName & "\" & theFolderName & " - " & theFileName into theFolderAndFileName
put "file:" before theFolderANdFileName
put MyDGColumnNames & CR & MyDGText into url theFolderANdFileName
end if
end if
...
...
I think just the platform qualifier will do.