Yep, that is exactly the behavior I would expect. I tried the same test cases a while back.
A) I started work on an embedded pdf viewer, looks like it will work. If you want to beta test it for me I can share when it is done.
B) If you want to share a uri follow these instructions , you will then use the FileProvider API to get a content uri from a file.
1) Make a local copy of p4a
---------------------------
Create a (or use existing) directory <some_path> BUT NOT the App directory
Go to
https://github.com/kivy/python-for-android/tree/masterFrom the "Code" button select download a zip file
Unzip and place in the directory <some_path>
In buildozer.spec set, for your value of <some_path>:
p4a.source_dir = <some_path>/python-for-android-master
2) Edit the AndroidManifest file.
---------------------------------
Edit:
<some_path>/python-for-android-master/pythonforandroid/bootstraps/sdl2/build/templates/AndroidManifest.tmpl.xml
Add the following lines at the end of the file, before "</application>"
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="{{ args.package }}.fileprovider"
android:grantUriPermissions="true"
android:exported="false">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
3) Specify the folders that can be shared.
------------------------------------------
Create a file 'provider_paths.xml' containing:
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="
http://schemas.android.com/apk/res/android">
<files-path name="app storage" path="."/>
</paths>
Place it in (create the xml directory) :
<some_path>/python-for-android-master/pythonforandroid/bootstraps/sdl2/build/src/main/res/xml
This example of provider_paths.xml enables sharing of the App local storage.
If you want to share some other location don't ask me, read the docs:
https://developer.android.com/reference/android/support/v4/content/FileProvider.html#SpecifyFiles4) Include the Java package containing FileProvider in buildozer.spec
---------------------------------------------------------------------
android.gradle_dependencies = "com.android.support:support-core-utils:27.0.0"