I am working on a project. It is about capturing photos from the PC and monitoring them on an Android phone screen.
I use JpegEncoder
or ImageIO
classes from the PC side and on the Android side I use BitmapFactory.decodeStream
method. When I send one image it works well but I need to send images continuously (2 or 3 images per second). It does not work in a while loop.
In logchat view it shows this error message until I close the Android application:
SkImageDecoder : Factory returned null
I think the problem is about cursor position in stream from ImageIO
code side the ImageIO.write(img,"jpg",ostream)
methot flushes stream after every sent but Android side
BitmapFactory.decodeBitmap() does not flush after every reading so the error is SkImageDecoder returned null