Skip to content Skip to sidebar Skip to footer

Storing Data On Sd Card In Android

Using the data-storage page in the docs, I've tried to store some data to the SD-Card. This is my code: // Path to write files to String path = Environment.getExternalStora

Solution 1:

Have you given your application permission to write to the SD Card?

You do this by adding the following to your AndroidManifest.xml:

<uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Solution 2:

Before reading or writing to SD card, don't forget to check the SD card is mounted or not?

Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)

Post a Comment for "Storing Data On Sd Card In Android"