I am currently using XML or JSON web services in various applications.
I just would like to know what would be the easiest way to cache theses of the answers in text files.
I was thinking about databases, but it seems pretty complicated!
So, I would like to do it
to save these xml / json files in phone memory, should i do something like this?
String FILENAME = "MyXmlFile";
String string = "hello world!";
FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos.write(string.getBytes());
fos.close();
In the onCreate of my application, I would like to parse this file. Since all the tutorials show how to parse a file from a web URL, I never found a way to parse an internal text file. Anyone have any advice on this?
Thank.