简体   繁体   中英

Share file with other Apps in android

I want to pass a file (ie .pdf, .png) from my android app to other apps on the device. I have read therefore the links setting Up file sharing and sharing a file . The files I want to share are not stored in my App, but I get them dynamically through URL links. What is the optimal way to share the files in that case? Is it necessary to store them in the App-store? And which path should I specify then as sharing path in Manifest.xml file ?

Update:

I do not want to store the files in an external-Storage but in my App-Storage. I save a file as:

File file = new File(getContext().getFilesDir() , "fileName");

My question is what path I should specify in the FileProvider Configuartion as the sharing path in that case? Or is it not necessary in this case?

What is the optimal way to share the files in that case?

Download the files, then share them.

And which path should I specify then as sharing path in Manifest.xml file?

If you mean for a FileProvider configuration, you configure FileProvider to serve the files from wherever you are downloading them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM