How to capture an Android camera image without saving the file to the phone / SD card?

I would like to capture the image using an Android camera, but since the image may contain sensitive data, I do not want the image to be saved on the phone or SD card. Instead, I need a base64 string (compressed) that will be immediately sent to the server

In PhoneGap, files are automatically saved in different places. Naturally, I could not get the stream of images - in onJpegPictureTaken (), the byte [] parameter was always zero.

can anyone suggest a way?

+3
source share
1 answer

See Camera.onPreviewFrame () and YuvImage.compresstoJpeg () for a byte array that you can convert to a bitmap.

, YuvImage.compressToJpeg() SDK 8 , . YUV. , .

SD. , , , , , , , , - .

!

+1

Source: https://habr.com/ru/post/1791345/


All Articles