How to Create a text file in Android? - Solved

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

How to Create a text file in Android? - Solved

Post by DR White » Sat Nov 30, 2013 8:02 pm

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
Last edited by DR White on Sat Nov 30, 2013 11:38 pm, edited 1 time in total.

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to Create a text file in Android?

Post by Klaus » Sat Nov 30, 2013 9:43 pm

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

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: How to Create a text file in Android?

Post by DR White » Sat Nov 30, 2013 10:09 pm

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

Post Reply