Android Local Storage files getting erased on reboot -


I have an Android app that stores data in local storage that is done just like the tutorial on Google's site :

  string FILENAME = "data.xml"; String string = "some content"; FileOutputStream fos = openFileOutput (FILENAME, context. MODE_PRIVATE); Fos.write (string.getBytes ()); Fos.close ();  

However, whenever the device turns off, the back is turned on, these files are removed how can I stay them?

I have not applied locally in this way, I try and in the way it is introduced Here, do it here:

http: // www. Webreference.com/authoring/languages/html/HTML5-client-side/

But this is the problem for me, because whenever I restart my iPhone, local storage is approved. .. Maybe client-side database, which is also mentioned on the above link, will help us :)

Edit: (after a few minutes)

Just restarted my iPhone And again tested my application - otherwise I would not allow myself to sleep tonight :) - This workplace There is quite a good article about local storage and in the end it is a very good example, whatever works, maybe the problem: the language of the article is German, but the example tells that he tells his story;)

< P> article: Example from the article: http: // www. Robocode.ch/lab/localstorage/

Explanation for non-German speakers: "Bleibt für ewig" - Entries will be there forever "browser browser browser browser or other browser browser (or browser)." - When the session expires, the browser entry is closed, the browser window is closed (depending on the browser)


Comments