android-fileprovider

Android app directory structure, email files from internal storage

余生长醉 提交于 2019-12-25 04:24:29
问题 I have a problem. I'm currently saving pdf files in the internal storage /data/user/0/com.thatapp.myApp/files/JP_31072016065930.pdf Reading it via the app is not a problem, so I'm positive it exists. I'm now trying to send the file via email. From the other questions and answers here, I gather that you need to use a file provider. So I added the following to my manifest <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.thatapp.fileprovider" android

External application is stopped when using FileProvider for opening file from internal storage

强颜欢笑 提交于 2019-12-25 02:55:25
问题 I have some files in custom folder in the internal storage. I need to open the files using external application like Adobe. I planned to open using FileProvider. But the third party application is stopped when trying to open the the document. I really don't know what mistake I did in the code. package name = "com.example.doc" activities are in package = "com.example.doc.activities" manifest <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.example.doc

Getting FileNotFoundException while capturing photo from Camera

谁都会走 提交于 2019-12-25 02:46:09
问题 I am using FileProvider.getUriForFile with given provider_paths.xml file. I am doing something wrong which I am not getting. <?xml version="1.0" encoding="utf-8"?> <paths xmlns:android="http://schemas.android.com/apk/res/android"> <external-path name="StrengGeheim" path="."/> </paths> This I added in my AndroidManifest.xml inside tag: <provider android:name="android.support.v4.content.FileProvider" android:authorities="${applicationId}.provider" android:exported="false" android

File Provider: Failed to find configured root that contains

元气小坏坏 提交于 2019-12-24 10:36:38
问题 I am using FileProvider to share media to other apps with the following code : Intent shareIntentt = new Intent(Intent.ACTION_SEND); shareIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); Uri contentUri = Fileprovider.getUriForFile(context, "com.app.tst", csOrignalFile); startActivity(Intent.createChooser(shareIntentt, getResources().getText(R.string.share))); Here is my provider under <application> tag in manifest : <provider android:name="android.support.v4.content.FileProvider"

Xamarin.Forms Android FileProvider: GrantWriteUriPermission not always working

一笑奈何 提交于 2019-12-24 09:43:06
问题 I want to edit files from the internal storage of my Xamarin.Forms Android app in third party apps, for example fill out form elements in a PDF file or edit a .docx file. With my implementation the file gets correctly opened in the external app, but in certain apps it is opened read-only . Adobe Acrobat and Microsoft Word open the files read-only, while other apps like Google Docs are able to write back into the file. (I am using Microsoft Word with a valid Office365 subscription). My

How to convert from Uri.fromfile to FileProvider.getUriForFile in Unity?

前提是你 提交于 2019-12-24 05:04:38
问题 I have a code from this answer code in unity to install an apk but it does not work in Android 7.0 because Uri.fromfile is no longer supported and FileProvider.getUriForFile should now be used. I tried opening the project in android studio and followed this tutorial to manipulate the manifest file - https://inthecheesefactory.com/blog/how-to-share-access-to-file-with-fileprovider-on-android-nougat/en AndroidJavaClass intentObj = new AndroidJavaClass("android.content.Intent"); string ACTION

Fileprovider doesn't work for image capture

倾然丶 夕夏残阳落幕 提交于 2019-12-23 12:44:53
问题 i've spent a lot of time trying to find a solution. I tried getExternalStoragePublicDirectory() and getExternalFilesDir() and many other things. But onActivityResult still brings error resultCode. It works when I switch from fileProvider to Uri.fromFile() only. But Android manual strictly recommends to use FileProvider for new APIs. Please tell me what I'm doing wrong. Manifest fragment: <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.mydomain.myapp

How can make a FileProvider available to other applications?

心已入冬 提交于 2019-12-23 07:41:25
问题 Is it possible to have a FileProvider available to other applications ? manifest.xml ... <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.example.myapp.fileprovider" android:exported="true" android:grantUriPermissions="false" android:permission="com.example.filesvisible.permission.READ" > <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/filespath" /> </provider> ... From the doc: false: The provider is not available

startActivityForResult not working in Android version 4.4 ( Kitkat version )

最后都变了- 提交于 2019-12-23 03:12:56
问题 Through my application the user can choose a file from the filemanager and process the choosen file ( Example: A PDF document ) for other steps like printing or to email. To do this I used the below code to display the intent, from which the user can choose a file from file-manager option. protected void showFileChooser(String title, String type) { Log.i(TAG, "FileChooserActivity showFileChooser(title,type)"); if (TextUtils.isEmpty(title)) title = getString(R.string.select_file); if

Opening a PDF file using FileProvider uri opens a blank screen

倾然丶 夕夏残阳落幕 提交于 2019-12-21 04:07:06
问题 I'm creating a PDF file on my app and writing it to the external storage, "Download" directory. Now, when I open it through my app with an intent action.VIEW using FileProvider uri, Google PDF Viewer displays a blank screen, Adobe Acrobat cannot even open the file. Here's my code to write the file and then trying to show it. Note that I'm sending a local notification and trying to open the file through the notification. try { File mypath=new File( Environment.getExternalStoragePublicDirectory