There is a Bitmap (Bitmap or its further conversion) object. How can I send it to the server? Himself in the study of advances.
1 answer
Bitmap bmp; ByteArrayOutputStream stream = new ByteArrayOutputStream(); bmp.compress(Bitmap.CompressFormat.PNG, 100, stream); byte[] byteArray = stream.toByteArray(); bmp.recycle(); RequestBody body = createRequestBody("application/octet-stream", byteArray); @POST Call<ResponseBody> post(@Body RequestBody body, @Url String url); |
post- Oleksiy Morenetspublic void setAttribute(String name, Object object);- Oleksiy Morenets