I'm new to file storage. My main goal is to take a picture with the camera, store it with good quality, then display it in an ImageView. I want to avoid asking for user permission (to use camera and external storage), and want to make this as simple as possible.
To take a picture, I'm using
val capturePicture = registerForActivityResult(ActivityResultContracts.TakePicture()) { it: Boolean -> }.
I don't know how to get the bitmap from this function or if I should. To my understanding I should send the uri when calling capturePicture.launch(uri).
My question is if this is correct, also how do I get the URI, save it to internal storage (.openFileOutput()), then load it from internal storage.
I prefer the answer in Kotlin but Java is fine too. An explanation on how paths work in internal storage could be helpful too.