Android File Sharing Example: What You Should Know
Android Tutorial → Sharing a file with a specific class
If you have already created a content URI, you can use it to share files between an app and app on other Android device.
Creating an app-specific content URI for an android app folder
This content URI is generated from the AndroidManifest.xml file of your existing app and not from new tags.
Android Tutorial → Sharing a file with other apps
To create an app-specific content URI, do the following: First, open app/ folder within internal storage of your Android device. For me, I just use internal storage, but in case your device has a non-preinstalled system apps folder, you should use a different folder. Inside the app/ folder within internal storage of your Android device, do the following: Create a new XML file and paste the following content URI into it. In other words, paste the following XML with the same name to this file on your Android device.
Detaining
... Then do the following: Create a new class that inherits from android.support.v7.app.AppCompatFileProvider. Then, declare the content URI in the constructor and pass the app ID of your other app that you want to share your files from. Override public abstract void uncreate(Bundle savedInstanceState) {super.uncreate(savedInstanceState); this.getApplicationId(getApplicationInfo().getApplicationId()); // set other apps' application ID using content URI setContentUri(getContentUri(fileManager)); // return value setApplicationLaunchParameters();}
The rest of the code is self-explanatory. You can then share the file and let other apps use the app ID in its file URI and file handle to access the shared file.
For example, if you have just created a new app with the name com.example.