============ Problem Description ============
If you can, how do I turn the image into JSON format? It is best to have source code. Thank you
============ Solution 1============
Obviously, the picture and the voice byte data can be base64 when the string is emitted and assembled into JSON is possible.
Just so the flow is too much, the general picture and voice are sent with a byte thin instruction is to use the TCP socket communication, without HTTP.
============ Solution 2============
Reference 3 Floor u010665680 's reply:
Quote: Referring to the reply of the 2 floor birdsaction:
Obviously, the picture and the voice byte data can be base64 when the string is emitted and assembled into JSON is possible.
Just so the flow is too much, the general picture and voice are sent with a byte thin instruction is to use the TCP socket communication, without HTTP.
OK, thank you. I turn the picture into a string and then wrap it in Jsonobject. It is then converted to a byte to write the output stream. Is that OK?
Of course. Pictures or text, in essence, are binary data, as long as the receiving end can be restored to the original data.
The Android client sends pictures and text to the server, similar to the tweet. Can I send it in JSON format?