Android Internal Storage |Android App Development With AndroidCource

Friday 15 September 2017

Android Internal Storage

Internal Storage


Store private data on the device memory.

Save files directly on the device's internal storage.

By default, files saved to the internal storage are private to your application and other applications cannot access the user.

Create and write a private file to the internal storage

Call openFileOutput() with the name of the file and the operating mode. This returns a FileOutputStream.

Write to the file with write().

Close the stream with close().

Methods of Internal Storage


getFilesDir()

Gets the absolute path to the filesystem directory where your internal files are saved.

getDir()

Creates (or opens an existing) directory within your internal storage space.

deleteFile()

Deletes a file saved on the internal storage.

fileList()

Returns an array of files currently saved by your application.

0 comments:

Post a Comment