I have an application in which I use the camera, the problem is that when I take the photo, the pixelated image appears in the preview of the Android camera application, here is an example:
I access the camera like this:
val takePictureIntent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
startActivityForResult(takePictureIntent, TAKE_PICTURE)
As I say, it is in the camera application itself where the image is pixelated, not in my application, where I later receive the image in this way as well.
The problem here is that if you unfold the image at the time of taking it, a low quality image is generated. When using the camera to save images, it is recommended to save it to the disk and later you can get it from the disk and it will be displayed with good quality.
Remember that for Android 6.0 you must require the permission
WRITE_EXTERNAL_STORAGE
manually, in addition to defining it in your fileAndroidManifest.xml
Storage permission error
I add a complete example: