On 3/18/12 9:35 PM, [email protected] wrote:
Misery loves company.  I saw your posting this morning so I tried to
save settings in my app.  No Luck.  I seem to be having the same
problem.

Here's working code from Casey's Solitaire, built on Android, which reads and writes a text file. I don't include the file in Copy Files when doing the build, it's created on first launch instead, but I don't see why copying it to the app bundle won't work. I add sound files into the build with the Copy Files pane and they work okay.


function readPrefsFile -- called elsewhere in the stack
  put getPrefsPath() into tPath
  if there is no file tPath then -- first launch
    put "false,false,false,true,true" into tData
    put tData into url ("file:" & tPath)
  else -- file exists
    put url ("file:" & tPath) into tData
  end if
  return tData
end readPrefsFile

on writePrefsFile pData
  put pData into url ("file:" & getPrefsPath())
end writePrefsFile

function getPrefsPath -- return writable location
  if the environment = "mobile" then
    put specialFolderPath("documents") & slash & "Casey.dat" into tPath
  else -- desktop; use stack folder
    put the effective filename of this stack into tPath
    set the itemDelimiter to "/"
    put "Casey.dat" into last item of tPath
  end if
  return tPath
end getPrefsPath

--
Jacqueline Landman Gay         |     [email protected]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to