1

I'm building an app that takes android image (captured by device camera) uploading it to server (servlet). In the server i need to work on it as BufferdImage (or any other java class). my problem is that an image in android is represnts as Bitmap object and BufferdImage is not supported in android. The opposite direction is also problem - i can't send the bitmap object to the servlet beacuse java don't supprt Bitmap object. I want to emphesize that I need to work on the image on the server side.

Does anyone know how can i solve this problem? Uploading the image to storage server and then use the url of the image is also acceptable answer.

Thanks in advance.

1 Answer 1

1

You can use that to get the image data:

ByteArrayOutputStream baos = new ByteArrayOutputStream(); bitmap.compress(CompressFormat.PNG, 0, baos); byte[] imgData = baos.toByteArray(); 

And then send the imgData to the server using a HTTPUrlConnection or whatever you are using for that. Then the server can read the byte data and build a BufferedImage with that.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.