I'm setting up camera app. There are functions like "capture" "rotate camera" "gallery" "back" etc. Application is running on emulator include all functions, but on real device, "capture" and "rotate camera" not working.
I have already tried the Instant Run - Clean & Rebuild App
MainActivity
camera.captureImage { camera, capturedImage ->
val savedPhoto = File(Environment.getExternalStorageDirectory(), "photo.jpg")
try {
val outputStream = FileOutputStream(savedPhoto.path)
outputStream.write(capturedImage)
outputStream.close()
} catch (e: java.io.IOException) {
e.printStackTrace()
}
//capturedImage converted to bitmap
var bitmap: Bitmap = BitmapFactory.decodeByteArray(capturedImage, 0, capturedImage.size)
capturedImageView.setImageBitmap(bitmap)
capturedImageView.visibility=View.VISIBLE
I expect the applications all functions run in both emulator and real device which is General Mobile 5 Plus