mime - Some file operations with DocumentsProvider API on Android -


documentsprovider api official way manage files on removable storage since android 5.0. but, seems, not support basic functionality. or, maybe, missed something?

  1. create new document (file) non-standard extension.
    documentscontract.createdocument(contentresolver, uri, mimetype, name)
    appends extension according mimetype. example, adds .txt 'text/plain' mime-type. question is: can create file name file.abc? if no, can register new mime-type, linked abc extension?

  2. move document.
    documentscontract.renamedocument(contentresolver, uri, newname)
    can rename document. can move document directory (change parent of document)? must create new document, copy content old one, , delete old document?

  3. set modification date of document.
    operation can useful in situation. example, in case must emulate filesystem move operation question 2. there way set required modification time document?

  1. yes can, depends on how documentprovider implemented device manufacturer.

  2. you can rename, parent cannot moved. you're right creating new document.

  3. no, setting last modified date not allowed till android 6.0. maybe in future.


Comments