How to perform basic operations on files using DocumentFile API?

时间:2015-08-14 22:54:17

标签: android android-5.0-lollipop documentfile

Background

Starting from API 21 (Lollipop), apps can get a special "permission" to modify real SD-cards, as shown on previous posts I've written (here and here).

The problem

I can delete files, and I can also create them, but I can't find a way to perform other basic file operations:

  • read, write, using InputStream and OutputStream
  • move files.
  • create a folder and not just a file
  • rename a file
  • get file info (recent updated,etc...)
  • share/open the file via other apps.
  • other operations I might have forgot about.

The question

How do I get those features? Surely it's possible to perform basic read and write, for example...

0 个答案:

没有答案