I have to make an update in my project and the client asked me to do this: the possibility to take a picture or choose a picture from gallery and putting at the same image component. I've read some posts but I didn't find any info on how to deal with this. Taking a picture it's working, but how to do this? My blocks to take picture are this way:
I need to take a picture or to get a picture from gallery and put at the same image component and I don't know which component I have to use when the user chooses a picture from gallery
@TIMAI2 thanks for your answer. And how to do to put the image which was got using ImagePicker at the same place as camera does? Something like this (I tested and didn't work, of course):
It crashes in APK too. May I have to consider READ_WRITE_STORAGE permission? I am testing on a Samsung with Android 8, but of course it will run in many Android versions.
It solved the crash (remember I am using a Samsung with Android 8). Now I've read about Android 11+ that these permissions are not used anymore. So how can I test the Android version?
You may need a setting in your manifest.xml as well. There is an extension to help you set this permission. Then you probably would not need to request the other permissions...
I see no reason at all to request MANAGE_EXTERNAL_STORAGE (on Android 11+). You only need WRITE_EXTERNAL_STORAGE on Android < 11. (This automatically grants READ permission on Android < 11.) On Android 11+ there is no longer WRITE permission, but READ_EXTERNAL_STORAGE on Android 11+12 (Android < 13) and READ_MEDIA_IMAGES on Android 13+.