Questions tagged [android-fileprovider]

FileProvider is an extension of Android's ContentProvder class, which supports easy sharing of private files between apps.

FileProvider supports easy sharing of private files between Android apps. When paired with features like grantUriPermission(String, Uri, int) or FLAG_GRANT_READ_URI_PERMISSION, this provider ensures that receiving apps can always open the underlying file.

Apps should generally avoid sending raw filesystem paths across process boundaries, since the receiving app may not have the same access as the sender. Instead, apps should send Uri backed by a provider like FileProvider.

Resources:

679 questions
3
votes
2 answers

Content uri crashes camera on Android KitKat

I run into problem while using content uri and FileProvider on Android API 19 (Kitkat). Here's code that I use to open camera on device and record a video: File file = new File(pathname); Uri fileUri = FileProvider.getUriForFile(this,…
Yenn
  • 200
  • 2
  • 11
3
votes
2 answers

Sharing a file in the raw folder with a FileProvider

I'm trying to pass an image that resides in the res/raw directory of my app along with a share intent. I followed the process described in the FileProvider docs, and here's my code: AndroidManifest.xml
Nitzan Tomer
  • 155,636
  • 47
  • 315
  • 299
3
votes
0 answers

Android FileProvider does not work with Google+ Photos

I'm trying to use the FileProvider way to display images using Intents. The basic setup is as follows: Uri contentUri = FileProvider.getUriForFile(getContext(), "my.domain.fileprovider", file); Intent i = new…
3
votes
0 answers

Why do I have to call the other app before using grantUriPermission?

I'm little bit puzzled about grantUriPermission function. I'd like to use it to grant file access to another application via a FileProvider. Since FileProvider must be local (non-exported) for good reason, I must grant the other app temporary…
3
votes
2 answers

Upload excel file to Dropbox or Google Drive?

I'm currently developing an application which creates an excel file(with apache poi) from the sqlite database in android. Everything is working well, except that I can't send the file to another app. I implemented an fileprovider so I other apps can…
Adrian
  • 807
  • 2
  • 12
  • 25
3
votes
2 answers

Why use FileProvider for external files?

I understand why a FileProvider is useful for sharing one app's private files (files in the app's Internal Storage) with another app, while controlling permissions. The docs explain how it can also be used to share files in External Storage (SD…
3
votes
0 answers

Permission denied when sharing image through intent

I'm trying to share an image from within an app's .apk (in res/drawable) using an Intent. Following the developer.android.com documentation ([1], [2], [3]), I assumed I needed to do the following: Get the image from res/drawable as a Bitmap and…
3
votes
2 answers

Hello-World of FileProvider

This question contained several sub-questions. I am forking these, starting by this question. I'll eventually clean up by deleting this question. The following program will in theory share a hello-world text file. The code runs, but sharing to…
Calaf
  • 10,113
  • 15
  • 57
  • 120
2
votes
1 answer

how to share an video from one app to another using file Provider?

I am trying to share an video from one app to another, but show me an error that "failed to find configure root/data/data/app_name/cache/videos/external files". I can't understand why it's not passing the uri to another app. can anyone help me to…
Aisha Kumari
  • 193
  • 2
  • 9
2
votes
0 answers

Android Sending Content URI using ContentProvider to Another App

I need to send image files (as rows using cursor) through ContentProvider to another app. I am storing the content URI of the image for sharing it with the app when queried. override fun query(uri: Uri, projection: Array?, selection:…
Ashwin
  • 7,277
  • 1
  • 48
  • 70
2
votes
0 answers

How to show image in android remote view using content URI?

I am having trouble trying to show an image in a remote view with a contentUri. I have outlined the steps I took below. I believe I have followed the procedure correctly but still get a "Can't load widget" message. What am I doing wrong? Is the…
2
votes
0 answers

ACTION_VIEW and FileProvider - how to open html file from sdcard in browser

I could not find a smart solution to my problem and that is why I decided to write to you good people. I have a question for your regarding FileProvider and ACTION_VIEW, namely, I save the html file this way: File sdcard =…
Dejo
  • 141
  • 1
  • 8
2
votes
1 answer

Android updating android.support.v4.content to androidx.core.content.FileProvider does not stay

I am trying to update the FileProvider class from android.support.v4.content.FileProvider to androidx.core.content.FileProvider which allows me to build successfully. When I run ionic cap sync it reverts back to…
2
votes
0 answers

'Couldn't find meta-data for provider with authority android.support.compat.provider but i'm using androidx.core.content.Fileprovider

When I try to use var apkURI = FileProvider.GetUriForFile(AndroidApp.Context, BuildConfig.ApplicationId + ".provider", file); I get Java.Lang.IllegalArgumentException: 'Couldn't find meta-data for provider with authority…
Pieter
  • 21
  • 1
  • 2
2
votes
0 answers

Open files in external apps with android (API 30) file provider with write access

I want to open files from my Android app (Cordova) in external apps with write access, so they can make changes. (Example: sign a PDF). The files to open are under external-files-path and can be opened. Unfortunately, the changes are not…