Save my data in Android

Klaus major-k klaus at major-k.de
Tue Sep 23 06:34:38 EDT 2014


Konichi-wa Takashi-san,

Am 23.09.2014 um 08:58 schrieb Takashi Yoshino <yoshino at sys.wakayama-u.ac.jp>:

> Hi,
> 
> I would like to save my data in Android.
> 
> I wrote some texts in the field in  my App on Android.
> When I quit my App, next time the text is lost.
> 
> Could you tell me how to save my text in the field on Android.

you are allowed to write in -> specialfolderpath("documents"),
so use something like this when the stack closes or whenever:
...
## Create a filename
put specialfolderpath("documents") & "/my_saved_text.text" into tFile
put the text of fld "your field here" into url("file:" & tFile)
...

To read the data in again, you first need to check if the file is present:
...
put specialfolderpath("documents") & "/my_saved_text.text" into tFile
if there is a file tFile then
  put url("file:" & tFile) into fld "your field here"
end if
...

Hope that helps!

> Best regards,
> 
> Takashi

Best

Klaus

--
Klaus Major
http://www.major-k.de
klaus at major-k.de





More information about the use-livecode mailing list