09.0 Data Storage
09.0 Data Storage
Preferences and
settings
Lesson 9
● Save new files that the user acquires through your app to a
public directory where other apps can access them and the user
can easily copy them from the device
● Save external files in public directories
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE" />
● External storage
myFile.delete();
● Internal storage
myContext.deleteFile(fileName);
● You can use the network (when it's available) to store and
retrieve data on your own web-based services
● Saving Files
● getExternalFilesDir() documentation and code samples
● getExternalStoragePublicDirectory() documentation and code samples
● java.io.File class
● Oracle's Java I/O Tutorial