Man. I spent hours creating a custom dialog that would ask the user if they want to export an XML file to the SD card or send it in an email. Then I decided it’s time to see how you would build such an implicit intent. The only answers I found so far are on Stack Overflow, and they say that you can only do such a thing for a file that is on the SD card. You can’t do it for files in an apps private storage area. Is this still true? You can’t email a file unless you put it on the SD card first?
I put the default xml files in the assets directory, so no one can mess with them, but I want them to be able to export them, make changes, and then import their changed versions. Imported files would be placed in the apps private data area. Now I am thinking to just let them export them to the SD card, and they can figure out how to send it as an attachment from their email client.
But that brings up another question. The directories on the SD card are very limited. Environment.DIRECTORY_DOWNLOADS is the only one that I can see using for xml files. Is it even possible to create your own directory on the SD card that is not a subdirectory of one of the existing ones? How do other apps manage the export/import of their own files?