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. As such, if both permissions are required, it is only necessary to request the WRITE_EXTERNAL_STORAGE permission:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.171.125