I have a client server application. Server is pure Java, client is an Android application. They communicate over TCP using ServerSocket.
I want to create an image on the server, edit it (for example, draw lines on it), and then send it to the client to display it there as a bitmap on the screen.
My first approach was to import the android.graphics.Bitmap library into the server in order to use it there, but, of course, since you cannot use the Android libraries outside of the Android environment, this will not work.
Now my approach is to use BufferedImage on the server, but the problem is that I could not find out how to serialize this so that the client could then recover the Bitmap. I tried using ImageIO.write, but then what do I need to do on the client side?
Does anyone have an idea on how to solve this problem, or do you have a better approach? I appreciate your help.
source share