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

What is the reason for including the "Access Camera" permission? #46

Closed milan-milojevic closed 8 years ago

milan-milojevic commented 8 years ago

Curious why the library is asking for the Camera permission, as this might put some people off.

miguelbcr commented 8 years ago

Hi @milan-milojevic !, because RxPaparazzo can use both, gallery and camera, in order to get the image. But in spite of asking you for permissions you could deny all of them forever by checking the option "No asking again" which appear the second time the popup is shown.

If it is not what you are asking for, please ask me again

milan-milojevic commented 8 years ago

Hi @miguelbcr

Thanks for the response, I am aware of that, and was referring to something else. As you can find in the official documentation:

If you request a hardware-related permission — CAMERA, for example — Google Play assumes that your application requires the underlying hardware feature and filters the application from devices that do not offer it.

Therefore, since RxPaparazzo can also use the gallery, I would rather it does not filter out all devices that do not have a camera (which it currently does). Also:

If you are using the camera by invoking an existing camera app, your application does not need to request this permission.

Since RxPaparazzo uses the default camera intent, there is no specific reason for this permission, unless it want's to handle the Camera view on its own (which it doesn't as far as I can tell).

Looking forward to your thoughts on this!

miguelbcr commented 8 years ago

Hi @milan-milojevic,

my mistake... you are right!

I've removed camera permission and I've tried it out on Android 6 and 7 and it works fine. Thanks for you report.

I've released version 0.2.8. You can try it out and let me know.

milan-milojevic commented 8 years ago

That's great to hear! Will do! I also wanted to check if you could update uCrop as they released a new version which dramatically reduces the APK size (1.5mb less) and has no specific migration issues:

compile 'com.yalantis:ucrop:2.2.0' - lightweight general solution

compile 'com.yalantis:ucrop:2.2.0-native' - get power of the native code to preserve image quality (+ about 1.5 MB to an apk size)

so compile 'com.yalantis:ucrop:2.2.0' would be great to have in another update!

milan-milojevic commented 8 years ago

@miguelbcr thanks for the responsiveness!

miguelbcr commented 8 years ago

Hi @milan-milojevic,

Thanks again!, I've released version 0.2.9 It's awesome how the final apk size is reduced

hemb commented 8 years ago

@miguelbcr, @milan-milojevic Are your sure the camera permission isn't needed?

With usingCamera() I get:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test/rx_activity_result.HolderActivity}: java.lang.SecurityException: Permission Denial: starting Intent { act=android.media.action.IMAGE_CAPTURE flg=0x3 cmp=com.android.camera2/com.android.camera.CaptureActivity clip={text/uri-list U:content://com.test.file_provider/RxPaparazzoImages/shoot.jpg} (has extras) } from ProcessRecord{d7d1e9b 31512:com.test/u0a82} (pid=31512, uid=10082) with revoked permission android.permission.CAMERA

hemb commented 8 years ago

Ok, I tried removing the camera permission from my manifest and now it's working. But I need the camera permission for other functionality in my app, so it would be great if RxPaparazzo could handle that situation as well.

miguelbcr commented 8 years ago

Hi @hemb,

thank for your comment. I've seen this post which explains that weird behaviour on devices with API >= 23

Try version 0.3.2 out and let me know if it works

hemb commented 8 years ago

@miguelbcr It's working now in 0.3.2. Thanks for the quick response!