android-fileprovider

Android File Provider Illegal Argument Exception

元气小坏坏 提交于 2019-12-04 23:35:44
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 file: <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.example" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/paths" /> </provider> My paths.xml file: <paths xmlns:android="http://schemas.android.com/apk/res/android">

Picking an image file from Gallery using FileProvider

戏子无情 提交于 2019-12-04 22:37:12
Compiling for Android N I've faced an issue of FileProvider . I need to let user to pick image from gallery/take picture with camera then crop it to square. I've managed to implement a FileProvider for taking image with camera, but I have serious problem with picking image from gallery. The problem is that in the gallery there are lot of files from different places and I've got the Exception for example: java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/6133-3766/DCIM/100ANDRO/DSC_0035.JPG So the question is, what can I put to file_paths.xml to get

FileProvider: Installing APK. There was an error parsing the package.

做~自己de王妃 提交于 2019-12-04 19:56:38
I have an APK-File in /storage/emulated/0/Download/app-debug.apk. I want to install this file by FileProvider because I am using Android N. When I try to launch the intent logcat doesn't show any error but I receive following message on my phone: There was a problem parsing the package. What am I doing wrong? MainActivity public class MainActivity extends AppCompatActivity { Button btnStartIntent; String strRootPathInternalStorage = Environment.getExternalStorageDirectory().toString(); //-> /storage/emulated/0 //-> /storage/emulated/0/Download/ String strApkToInstall = "app-debug.apk";

FileProvider Class Unresolved

梦想与她 提交于 2019-12-04 18:26:16
I am trying to do this tutorial . I have followed all the steps but I am unable to build due to an error stating Unresolved Class FileProvider I have the support repository installed. My current grade is as follows: apply plugin: 'com.android.application' android { compileSdkVersion 26 defaultConfig { applicationId "com.mydomain.example" minSdkVersion 19 targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard

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

折月煮酒 提交于 2019-12-04 03:00:05
问题 I am using FileProvider in my app. As usual I declared <Provider> tag in AndroidManifest.xml file as below. <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.jk.android.fileprovider" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" /> </provider> When I run it on android device which has lollipop version it works fine. when I try it on kitkat

Open downloaded file on Android N using FileProvider

谁说胖子不能爱 提交于 2019-12-03 16:59:46
问题 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 the Download folder and calls an ACTION_VIEW intent as soons as the DownloadManager tells he's finished downloading: BroadcastReceiver onComplete = new BroadcastReceiver() { public void onReceive(Context ctxt, Intent intent) { Log.d(TAG, "Download

FileProvider error

巧了我就是萌 提交于 2019-12-03 16:29:48
问题 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) on the line: Uri photoURI = FileProvider.getUriForFile(this, "com.example.android.fileprovider", photoFile); I know I need to configure the FileProvider in my app's manifest and the "authorities" has to match. I don't quite understand what I should

Android 7 nougat, how to get the file path from uri of incoming intent?

£可爱£侵袭症+ 提交于 2019-12-03 16:06:51
FileProvider:- Setting up file sharing I know that change the file policy in android nougat. The wanted app that file share to other apps generate the uri by FileProvider. The uri format is content://com.example.myapp.fileprovider/myimages/default_image.jpg . I want know that how can I get filepath from the uri that generate by FileProvider.getUriForFile() . because the my app is need to know the physical filepath in order to save, load, readinfo, etc. is it possible [In short] My app received the intent uri by other apps on andorid 7 nougat. The uri format is content://com.example.myapp

FileProvider - Open File from Download Directory

北城以北 提交于 2019-12-03 15:50:33
问题 I can't open any file from Download Folder. I can download a file and save in Download Folder with this: DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url)); request.setDescription(descricao); request.setTitle(titulo); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { request.allowScanningByMediaScanner(); request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); } request.setDestinationInExternalPublicDir(Environment

Intent ACTION_OPEN_DOCUMENT_TREE doesn't seem to return a real path to drive

混江龙づ霸主 提交于 2019-12-03 14:10:55
问题 I'm trying to read files from a USB storage device connected to my Google Pixel. I'm currently using this method to select the path of the drive so I can query it for its contents private static final String TAG = "MainActivity"; private static final int REQUEST_CHOOSE_DRIVE = 1; private TextView tv; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tv = (TextView) findViewById(R.id.text); Intent i = new