android-fileprovider

Android - file provider - permission denial

隐身守侯 提交于 2019-11-26 22:01:41
I have two apps : app1 and app2. App2 has : <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.android.provider.ImageSharing" android:exported="false" android:grantUriPermissions="true" > <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/paths" /> </provider> paths.xml : <paths> <files-path name="my_images" path="images/"/> </paths> App2 receives request in its Activity from App1 to get URI for an image. The App2 Activity does the following once URI is decided : Intent intent = new Intent(); intent.setDataAndType

SecurityException with grantUriPermission when sharing a file with FileProvider

此生再无相见时 提交于 2019-11-26 16:35:22
问题 I have two applications. I'm trying to share a file from application A to application B using a FileProvider. Application A calls the insert method on a ContentProvider in Application B to insert a record. The data inserted includes the Uri to the file I want to share from App A. The ContentProvider in App B would then try to read the shared file from App A. Since I'm not using an Intent to share the file, I'm calling Context.grantUriPermission in App A to allow the read (and at times write):

FileProvider - IllegalArgumentException: Failed to find configured root

隐身守侯 提交于 2019-11-26 15:06:21
I'm trying to take a picture with camera, but I'm getting the following error: FATAL EXCEPTION: main Process: com.example.marek.myapplication, PID: 6747 java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/emulated/0/Android/data/com.example.marek.myapplication/files/Pictures/JPEG_20170228_175633_470124220.jpg at android.support.v4.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:711) at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:400) at com.example.marek.myapplication.MainActivity

Android - file provider - permission denial

孤人 提交于 2019-11-26 12:25:11
问题 I have two apps : app1 and app2. App2 has : <provider android:name=\"android.support.v4.content.FileProvider\" android:authorities=\"com.android.provider.ImageSharing\" android:exported=\"false\" android:grantUriPermissions=\"true\" > <meta-data android:name=\"android.support.FILE_PROVIDER_PATHS\" android:resource=\"@xml/paths\" /> </provider> paths.xml : <paths> <files-path name=\"my_images\" path=\"images/\"/> </paths> App2 receives request in its Activity from App1 to get URI for an image.

Image share intent works for Gmail but crashes FB and twitter

自古美人都是妖i 提交于 2019-11-26 07:37:15
问题 I am trying to allow the user to share an image to other apps on the device. The image is inside the files/ subdirectory of my app\'s internal storage area. It works just fine with Gmail, but Facebook and Twitter both crash when responding to my intent. EDIT: Google+ also works fine. Here are the relevant sections of code. In Application.xml <provider android:name=\"android.support.v4.content.FileProvider\" android:authorities=\"org.iforce2d.myapp.MyActivity\" android:exported=\"false\"

Android install apk with Intent.VIEW_ACTION not working with File provider

强颜欢笑 提交于 2019-11-26 07:19:36
问题 My app has an auto-update feature that download an APK and when the download is finished that a Intent.VIEW_ACTION to open the app and let the user install the downloaded apk Uri uri = Uri.parse(\"file://\" + destination); Intent install = new Intent(Intent.ACTION_VIEW); install.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); install.setDataAndType(uri, manager.getMimeTypeForDownloadedFile(downloadId)); activity.startActivity(install); This works great for all the device < 24 Now with Android 24

How to use support FileProvider for sharing content to other apps?

拜拜、爱过 提交于 2019-11-26 00:25:02
问题 I\'m looking for a way to correctly share (not OPEN) an internal file with external application using Android Support library\'s FileProvider. Following the example on the docs, <provider android:name=\"android.support.v4.content.FileProvider\" android:authorities=\"com.example.android.supportv4.my_files\" android:grantUriPermissions=\"true\" android:exported=\"false\"> <meta-data android:name=\"android.support.FILE_PROVIDER_PATHS\" android:resource=\"@xml/my_paths\" /> </provider> and using

Getting the Absolute File Path from Content URI for searched images

拜拜、爱过 提交于 2019-11-25 22:23:48
问题 I am trying to share images from other applications to my application using implicit intent ACTION_SEND. While sharing search images from chrome browser, app receives intent with a Content URI like this: content://com.android.chrome.FileProvider/images/screenshot/1457448067808912906311.jpg How can I fetch file path from this type of Content URI? All other apps like Facebook, Google+ are doing it. I am using FileChooser for getting file path of other types of Content URIs (eg. from Gallery).