Android Question What needs to be adjusted in the FileProvider manifest?

Sandman

Expert
Licensed User
Longtime User
This originates from my wish:

In that thread Erel said:
The problem with automatically adding snippets is that there are cases where you need to customize the snippet. This includes the FileProvider snippet.

But looking at the manifest from FileProvider, I cannot for the life of me see what needs to be customized. Can somebody please point to the thing that I am missing? :)
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The snippet:
B4X:
AddManifestText(<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
)

AddApplicationText(
  <provider
android:name="android.support.v4.content.FileProvider"
android:authorities="$PACKAGE$.provider"
android:exported="false"
android:grantUriPermissions="true">
  <meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
  android:resource="@xml/provider_paths"/>
  </provider>
)
CreateResource(xml, provider_paths,
<files-path name="name" path="shared" />
)

1. If you need the WRITE_EXTERNAL_STORAGE permission for other reasons then you don't want to limit the maxSdkVersion to Android 4. Less relevant with recent restrictions but still.
2. There are some cases where developers wanted to change the shared path. You can find it on the forum. Maybe because of compatibility with an existing app that they are upgrading.
 
Upvote 0
Top