Page 1 of 1

How to Create a text file in Android? - Solved

Posted: Sat Nov 30, 2013 8:02 pm
by DR White
Please give me an example of How to Create a text file in Android.

I just want to read and write a small amount of text to the user's file.


I have been banging my head for several hours now and it time to ask for help. :(

Thanks,

David

Re: How to Create a text file in Android?

Posted: Sat Nov 30, 2013 9:43 pm
by Klaus
Hi David,

sorry, looks like I made a mistake in the "30 variables.." thread.
Here is the correct way!

Write variable to file:

Code: Select all

...
put specialfolderpath("documents") & "/name_of_your_file_here" into tFile
put tVariable into url("file:" & tFile)
...
Read variable from file:

Code: Select all

...
put specialfolderpath("documents") & "/name_of_your_file_here" into tFile

## Dont forget to check this!
if there is a file tFile then
  put url("file:" & tFile) into tvariable
end if
...
Best

Klaus

Re: How to Create a text file in Android?

Posted: Sat Nov 30, 2013 10:09 pm
by DR White
KLAUS,

It sure would have made my day a little brighter, if you could have given me that information earlier.

It now works great! :)

Thanks always for your help,

David