Posts

Showing posts with the label Android - Internal Storage Tutorial

Android - Internal Storage Tutorial

Image
Android provides many kinds of storage for applications to store their data. These storage places are shared preferences, internal and external storage, SQLite storage, and storage via network connection. In this chapter we are going to look at the internal storage. Internal storage is the storage of the private data on the device memory. By default these files are private and are accessed by only your application and get deleted , when user delete your application. Writing file In order to use internal storage to write some data in the file, call the openFileOutput() method with the name of the file and the mode. The mode could be private , public e.t.c. Its syntax is given below − FileOutputStream fOut = openFileOutput ( "file name here" , MODE_WORLD_READABLE ); The method openFileOutput() returns an instance of FileOutputStream. So you receive it in the object of FileInputStream. After that you can call write method to write data on the file. Its syntax is g...