To save data into file in an android application, you have to follow the steps given bellow. 1. Create an object of the FileOutputStream class using the openFileOutput method. Example : FileOutputStream fou = openFileOutput("text.txt", MODE_WORLD_READABLE); Here text.txt is the name of the file. You can use any of the file opening mode a. MODE_PRIVATE : File is accessible by only the application that create it. b. MODE_APPEND : Appending an existing file. c. MODE_WORLD_WRITABLE : Allow write permission to all the applications. 2. Get an object of the OutPutStreamWriter class using the FileOutputStream object. Example: OutputStreamWriter osw = new OutputStreamWriter(fou); 3. Writ...
Computer Programming Video Tutorials