<p dir="ltr">Hello,
<br>
<br>
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.
<br>
In lolipop, google introduce yet another API to change that.
<br>
<br>
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.
<br>
After that, it's possible to write in that folder using DocumentFile API from the tree uri.
<br>
<br>
I did some testing, i implemented a preference to select/set write permissions and get tree uris (and revoke them by selecting them again).
<br>
<br>
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.
<br>
<br>
So the patch is mainly a poc, but that's a start, what do you think ?</p>