-1

I have made a folder named "files" in the package of my app.
Now I want to create a text file in that folder on the click of button.
The file should open in append mode and a List or ArrayList should be written in that file.

Also how do I read ArrayList from that file and print it?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Ted
  • 116
  • 10

1 Answers1

0

This is a very generic question, so this will be a very generic answer:

-See here for details on saving files, using internal/extrernal storage etc: http://developer.android.com/training/basics/data-storage/files.html

-To append to a file use the right mode: openFileOutput("file.dat", MODE_APPEND | MODE_WORLD_READABLE );

-to put an arraylist to file and retrieve it you should serialize it: Save an ArrayList to File on android

Community
  • 1
  • 1
Evripidis Drakos
  • 872
  • 1
  • 7
  • 15