Permission to read data from SD Card

前端 未结 6 389
北海茫月
北海茫月 2021-01-08 01:01

Do you need any permission to read data from an sdcard? I found the write permission but nothing for read.

相关标签:
6条回答
  • 2021-01-08 01:37

    Key here is what you want to read. As mentioned above, you need the permission if you are reading content NOT created by your app. Some devices lets you get away with this also, provided the developer options allow it on the device. But better to include it in the manifest.

    If you are only reading what you wrote using the same app, no explicit permission is required.

    0 讨论(0)
  • 2021-01-08 01:37

    You need to add WRITE_EXTERNAL_STORAGE permission if you want to dir get list file.

    0 讨论(0)
  • 2021-01-08 01:41

    If you are using android version 4.1 (Jelly Bean), you have to insert the following permission into your application's manifest file:

    READ_EXTERNAL_STORAGE
    

    http://developer.android.com/reference/android/Manifest.permission.html#READ_EXTERNAL_STORAGE

    0 讨论(0)
  • 2021-01-08 01:49

    No special permissions are required to read data on the SD card. By virtue, anything you store on the SD card is visible for any app to read.

    For more information, the Android documentation on the matter is here: http://developer.android.com/guide/topics/data/data-storage.html

    0 讨论(0)
  • 2021-01-08 01:55

    Do not forget to add

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

    to your manifest file

    0 讨论(0)
  • 2021-01-08 02:01

    On a linux system cd to the sd card you may have a long path name to copy and paste. Try "sudo nano" or sudo vi depending on the editor you like. This enabled me to read files I could not open on the SD card with my standard gui based text editor.

    For example in the GUI I tried to open passwd- file in /etc on my SD card. The icon has a little x on it. Leafpad my linux editor Failed to open the file '/media/UserDrake/28d3774e-c2bd-486f-bde0-3cbb17d2317c/etc/passwd-' permission denied. However if I use terminal cd / then cd to the just mentioned path using cut and paste because it really is long to type. I CAN see it with sudo nano "above path"

    0 讨论(0)
提交回复
热议问题