[Android] Writing on external sdcard

XilasZ xilasz at gmail.com
Wed Aug 5 12:15:47 CEST 2015


Erf, the patch got lost somewhere in gmail, let's try again :)
Le 5 août 2015 12:11, "Geoffrey Métais" <geoffrey.metais at gmail.com> a
écrit :

> We had a look at it.
>
> Getting write permission for the whole SD card requires user select the SD
> card root folder in Google picker UI, then we store this permission.
> That's not user friendly, so we did not spend time on it.
>
> But if you have something, we are interested by your patch for sure :)
>
> On Wed, Aug 5, 2015 at 11:52 AM XilasZ <xilasz at gmail.com> wrote:
>
>> Hello,
>>
>> As you may know, since KitKat, apps can't write on external sdcards
>> (except in app private folder, but using a new API), so we can't delete
>> file on external sdcard anymore.
>> In lolipop, google introduce yet another API to change that.
>>
>> First, the app calls ACTION_OPEN_DOCUMENT_TREE to ask the user to select
>> a folder (for instance /sdcard2/Movies), it return a tree uri
>> (/tree/3638-3334:Movies) and then we can set a write permission on this
>> folder.
>> After that, it's possible to write in that folder using DocumentFile API
>> from the tree uri.
>>
>> I did some testing, i implemented a preference to select/set write
>> permissions and get tree uris (and revoke them by selecting them again).
>>
>> I don't know yet how to know if a path is under a tree uri, how to get a
>> DocumentFile from a real path (/sdcard2/Movies/blabla.mp4), or if it's even
>> possible.
>>
>> So the patch is mainly a poc, but that's a start, what do you think ?
>> _______________________________________________
>> Android mailing list
>> Android at videolan.org
>> https://mailman.videolan.org/listinfo/android
>>
>
> _______________________________________________
> Android mailing list
> Android at videolan.org
> https://mailman.videolan.org/listinfo/android
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/android/attachments/20150805/aa3316f4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add-preference-to-enable-writing-on-ext-sdcard.patch
Type: application/octet-stream
Size: 7327 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/android/attachments/20150805/aa3316f4/attachment.obj>


More information about the Android mailing list