Is it possible to attach file to JSONObject in Java (and to JSON at all)?
For example, can I attach bitmap to ‘image’ field?
{'user_id':'5', 'auth_token':'abc', 'image': ???}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can convert the bitmap (or any binary data) to text using base64 (which makes it a String) I wouldn’t use one of the Base64 classes in the JVM unless you are fully aware that they are for internal use. (may not be available on all JDKs and could change in future versions)
You could copy java.util.prefs.Base64 if you don’t have one in a library already.