I have an app that needs to support API 7 through lollipop; until KitKat, 
it used 'File' objects to talk to the local file system. I had planned to 
use DocumentFile as a simple solution to my problems. However, I can not 
see simple ways to do the following:

1. Save the equivalent of "path and file"; I used to save the last file 
written (an export or backup) then next time the user performed this 
operation, attempted to return them to the same directory.

How is this done? In the 'io.File' world, I just save the result of 
getAbsolutePath(). In the DocumentFile world (or even the DocumentContract 
world) there does not seem to be an equivalent. How can I return the user 
to the same location next time?


2. IF I can return to the user to the "same place" next time they try to 
open/save, how do I allow them to navigate back up the tree? Sure, a file 
can have parents, but I can not see any calls that show me the parents, 
which kind of makes remembering locations useless. But failing to remember 
them is equally useless in large file trees. 


3. If I use the new APIs, I can get document IDs. This is great, but do 
they encode the provider? Is there a call to say "I have no idea who the 
provider was, just open this doc please, here is the ID...?". This is 
related to (2), but also important for using files within the app.


4. io.File has a set of functions relating to temp files. If I move over 
solely to the new APIs, how can I create a temporary file IN THE SAME 
PARENT as a given file, so that when the output is complete, I just do a 
delete/rename (to avoid blowing away the previous file until I know the new 
file it fully written).


5. I notice that DocumentFile keeps a link to parents internally. Does it 
support serialization, and if so, do the parents also get serialized?


Sorry for so many questions, but every time I try to use the new API I seem 
to hit roadblocks, and all the samples seem overly simplisitic.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to