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
14
votes
3 answers

No Activity found to handle Intent when using FileProvider

In my app I have a custom auto download and install APK it works like this // auto register for the complete download activity.registerReceiver(onComplete, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE)); // Download the file…
Johny19
  • 5,364
  • 14
  • 61
  • 99
14
votes
2 answers

Android File Provider Illegal Argument Exception

I am using file provider to save photo to a given destination. I get: java.lang.IllegalArgumentException: Missing android.support.FILE_PROVIDER_PATHS meta-data while trying to open activity to capture image from camera. My manifest.xml…
14
votes
3 answers

FileProvider error

https://developer.android.com/training/camera/photobasics.html All I am trying to do is take a picture with the Camera, save it and display it in an ImageView. I followed the android tutorial above and keep getting an error (a NullPointerException)…
rafvasq
  • 1,512
  • 3
  • 18
  • 48
13
votes
4 answers

PDF file when opening in Android Nougat is showing blank screen

I am creating a PDF file and saving it in local storage. When trying to open it, it is working perfect in all devices except in Android N. I am able to open PDF file in Android N using FileProvider, but it is displaying as blank. This is my URI …
Sabya Sachi
  • 145
  • 2
  • 10
13
votes
6 answers

Open downloaded file on Android N using FileProvider

I've got to fix our App for Android N due to the FileProvider changes. I've basically read all about this topic for the last ours, but no solution found did work out for me. Here's our prior code which starts downloads from our app, stores them in…
althaus
  • 2,009
  • 2
  • 25
  • 33
11
votes
2 answers

How to resolve Android 10's Storage Mess

As Android is very inconsistent between different major Versions regarding File access, I feel a bit lost. I try to describe the problem as easy as possible: My Company uses a commercial native DRM to protect other native library's we provide. We…
11
votes
9 answers

android.support.v4.content.FileProvider class not found in android Kitkat

I am using FileProvider in my app. As usual I declared tag in AndroidManifest.xml file as below.
11
votes
3 answers

Android - FileProvider getUriForFile when the file is on an external SD

Currently, FileProvider getUriForFile method generates IllegalArgumentException when the file is on an external SD When the file is in the device memory (under /storage/emulated/0), it works fine. Uri videoUri = FileProvider.getUriForFile(this, …
u2gilles
  • 6,888
  • 7
  • 51
  • 75
11
votes
1 answer

Why using a FileProvider I can't open file from INTERNAL STORAGE with external apps?

I created an app which can import file in its internal storage. In order to open a file with an external app (for example PF viewer or Photos) I tried to follow these guides: the official guide, topic1, topic2, topic3 and topic4 but without…
11
votes
1 answer

Content URI passed in EXTRA_STREAM appears to "To:" email field

I am creating a file in the cache directory that I'd like to share with others (via Gmail / WhatsApp etc). I am able to do this using FileProvider, and it works OK for WhatsApp. When choosing to share on Gmail the photo is correctly attached, but…
Simon Huckett
  • 482
  • 5
  • 13
10
votes
5 answers

How to Get File Path from URI in Android Oreo (8.1) or above

Expected Behavior When I am selecting the file which is stored inside "Download", it should able to retrieves its file name and path Actual Behavior When I am selecting the file which is stored inside "Download", it returns null. Steps to Reproduce…
10
votes
1 answer

How can make a FileProvider available to other applications?

Is it possible to have a FileProvider available to other applications ? manifest.xml ...
M'hamed
  • 2,508
  • 3
  • 24
  • 41
9
votes
1 answer

Saving file using Storage Access Framework in Android

I am integrating the Document Access Framework with my cloud storage access app. Using this documentation I have been able to access the file and retrieve it (I simply use Gmail app's attach function to check this). I am now trying to find how to…
rydgaze
  • 1,050
  • 13
  • 24
9
votes
3 answers

Android file chooser with specific file extensions

I need to show only 'pdf' files in my application when I run default File chooser I'm not able to filter file extensions. final Intent getContentIntent = new Intent(Intent.ACTION_GET_CONTENT); getContentIntent.setType("application/pdf"); …
Nande kore
  • 784
  • 1
  • 8
  • 16
8
votes
3 answers

Android 10 - file provider - permission denial: reading android.support.v4.content.FileProvider uri

I've tried to generate a CSV file (of Accelerometer), save it to my Context.getFilesDir(), and then use FileProvider to share it to Google Drive. The problem is when I try to share it, error Writing exception to parcel, java.lang.SecurityException:…
Charles Chung
  • 103
  • 1
  • 1
  • 10
1 2
3
45 46