miguelbcr / RxPaparazzo

RxJava extension for Android to take images using camera and gallery and pick files up
Apache License 2.0
465 stars 53 forks source link

Android 11 issue #109

Open akshayspaceo opened 3 years ago

akshayspaceo commented 3 years ago

This library is not working in android 11

sandeep212chary commented 3 years ago

Hi any suggestions not working in android 11

galmax1 commented 3 years ago

You can try .useInternalStorage(). In my case it works! But the image will not be available in the device gallery.

HaneetGH commented 2 years ago

You can try .useInternalStorage(). In my case it works! But the image will not be available in the device gallery.

Isn't working

HaneetGH commented 2 years ago

Google stops accepting apps which are not compiling with api 30. Please fix this issue

HaneetGH commented 2 years ago

You can try .useInternalStorage(). In my case it works! But the image will not be available in the device gallery.

I make it work a after adding useInternalStorage here add <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" android:minSdkVersion="30" /> in manifest

   and 

public void askForPermissions(boolean camera) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { if (!Environment.isExternalStorageManager()) { Intent intent = new Intent(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION); startActivity(intent); return; } performImgPicAction(camera);

    }
}
antaki93 commented 2 years ago

You can save your photos to external directory "/Pictures/MySomeDirectory" on Android 11 without additional permissions. Set custom values in file_provider_paths.xml:

<files-path name="MySomeDirectory" path="Pictures"/>

and init the RxPaparazzo using:

RxPaparazzo.register(context).withFileProviderPath("Pictures/MySomeDirectory")

UPD: As I understand, you can use at least 4 directories: DCIM, Download, Movies, and Pictures. Each of them described as "top-level public directory" here: https://developer.android.google.cn/reference/android/os/Environment#DIRECTORY_PICTURES

Zhuinden commented 1 year ago

I added following queries to AndroidManifest.xml

<queries>
    <intent>
        <action android:name="android.media.action.IMAGE_CAPTURE" />
    </intent>

    <intent>
        <action android:name="android.intent.action.GET_CONTENT" />
        <data android:mimeType="image/*" />
    </intent>

    <intent>
        <action android:name="android.media.action.IMAGE_CAPTURE" />
    </intent>
</queries>