Working with external storage
External storage is used to create and access non-private, shared, world-readable files. Shared external storage is supported by all Android devices. The first thing you need to start using external storage is its permission.
Getting external storage permission
The READ_EXTERNAL_STORAGE
and WRITE_EXTERNAL_STORAGE
permissions must be acquired by your application before it can make use of external storage APIs. READ_EXTERNAL_STORAGE
is necessary when you only need to read from external storage. The WRITE_EXTERNAL_STORAGE
permission is necessary when your application requires the ability to write directly to external storage.
These two permissions can be added with ease to the manifest file, as we have seen in previous chapters:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
It should be noted that WRITE_EXTERNAL_STORAGE
implicitly includes READ_EXTERNAL_STORAGE...