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
0
votes
0 answers

Android: Passing a file to external app from "documents" folder as read-only

My app opens some files in external apps for editing purpose. In some cases the external app can save the file, in other cases the app cannot save the file. The file is a normal file in the "documents" folder so it is not private and it is not…
P5music
  • 3,197
  • 2
  • 32
  • 81
0
votes
1 answer

Share image with FileProvider or MediaStore

I have to following problem. I want to share an image using intent chooser to the as many apps as possible. To achieve that I have two options: Save the image to MediaStore. But that means that image will show up in the gallery without user's…
klemzy
  • 492
  • 1
  • 6
  • 12
-1
votes
0 answers

Android: FileProvider java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/emulated/0/Download/apks/apk.apk

my app downloaded apk to downloads/apks/ dir. I trying to install it, but had this error.Can you help? I use fileProvider to get access to apk file. I have already tried all tags and a lot of path combination but it is not working anyway This is…
-1
votes
1 answer

Unable to open file using FileProvider

I wish to open a file from downloads folder (/storage/emulated/0/Download) and this is my code I first check if the file exists File file = new File("/storage/emulated/0/Download" + File.separator + + ".pdf"); …
-1
votes
1 answer

How to open Pdf from application to default viewer?

I'm trying to open pdf from my application to default document viewer in Nougat. This is not duplicate cause I have different problem than others so read till end . What I've tried: I know i have to use FileProvider , Make provider.xml , get…
-1
votes
1 answer

java.lang.IllegalArgumentException on Capture Image using camera

When I try to capture image using Camera I am getting an error, FATAL EXCEPTION: main Process: com.test.driver, PID: 10512 java.lang.IllegalArgumentException: Failed to find configured root that contains…
SHIDHIN TS
  • 1,557
  • 3
  • 26
  • 58
-1
votes
2 answers

Paths Issue while retrieving a photo

i have a problem with paths while taking a photo and setting it to an ImageView. when i use this method File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES); the path used is 02-01 12:07:24.068 31618-31618/disco.unimib.it.polapp…
-1
votes
1 answer

Where i should save images to use it with Fileprovider

i have read the documentation about Fileprovider but i don't understand where i should put the images (or path of the images) that i want share. I understand that with xml file "file_path" i set the new path when my app share the images. I also…
Smart
  • 445
  • 1
  • 5
  • 12
-1
votes
1 answer

android sdk android-support-v4.jar

I tried to use FileProvider in my apk and got an error "FileProvider cannot be resolved". According to the official documentation of FileProvider https://developer.android.com/reference/android/support/v4/content/FileProvider.html I added import…
i716
  • 139
  • 1
  • 1
  • 5
-1
votes
3 answers

Null Pointer Exception in File Provider

Ive designed a simple fragment to take a Picture and then load the corresponding picture on an ImageView on the screen using a File Provider. Im currently getting a null pointer exception when accessing it although it is there and under the correct…
Praveen
  • 85
  • 7
-1
votes
1 answer

Why not getUriFromFile in StreamProvider?

I'm using https://github.com/commonsguy/cwac-provider to share files stored in "getExternalFilesDir", because Android FileProvider has no tag for this (although the documentation says it has, you know it's an old mistake in such documentation) I…
Sergio Viudes
  • 2,714
  • 5
  • 26
  • 44
-1
votes
2 answers

Getting couldn't send attachment error while attaching images with Gmail app

I have a file path of images which was taken from the Gallery and I am adding each file path in to ArrayList. Everything works fine and even I could see the attachments in Gmail. But once if I try to send the images. I am getting couldn't send…
Chandru
  • 5,954
  • 11
  • 45
  • 85
-2
votes
2 answers

How to get Oreo sdCard path?

I want to delete duplicate files from SD Card. So i need to access SD Card files which give me the full path. eg. /storage/0C08-291C/Android/Docs/file-sample_500kB.rtf I got the SD Card path for all Android version greater than SDK level 22 but not…
-2
votes
2 answers

Create and show PDF reports in internal storage android

I am making an android app in which I have to make PDF reports. The data for these reports comes from SQLite database. The PDF pages are being created correctly but I have problem in showing them. The PDF is not shown. I want the PDF page to display…
-2
votes
2 answers

Android uri not works on on 6.0 above device how to fixed it?

Hello friend i am working mp3 player my Uri uri = Uri.parse("file:///"+song.getGetpath()); works fine on 6.0 device but its not workin 6.0 above device how to fixed using fileprovider i dont know to use how to use fileprovider i am…
maha songs
  • 85
  • 10
1 2 3
45
46