Getting Response as Response ID 525295 is not served in this process
RequestQueue queue = Volley.newRequestQueue(HomeScreen.this);
//Create your body
JSONObject jsonRequest = new JSONObject();
try {
jsonRequest.put("photo_one", byteArrayToHexString(imageByteArray1));
jsonRequest.put("photo_two", byteArrayToHexString(imageByteArray2));
jsonRequest.put("photo_three", byteArrayToHexString(imageByteArray3));
jsonRequest.put("product_titile", mTitle.getText().toString());
jsonRequest.put("product_description", mDiscription.getText().toString());
jsonRequest.put("location", mAddress.getText().toString());
jsonRequest.put("name", mPername.getText().toString());
jsonRequest.put("mobile", mPerMobile.getText().toString());
} catch (JSONException e) {
Log.i("Exception", e.toString());
}
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST, URL, jsonRequest, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.v("Response", response.toString());
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.v("Error", error.getMessage());
}
}){
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> headers = new HashMap<String, String>();
headers.put("Content-Type", "application/json; charset=utf-8");
return headers;
}
};
//Add request to queue
queue.add(jsonObjectRequest);
@NonNull
private static String byteArrayToHexString (byte[] a) {
StringBuilder sb = new StringBuilder(a.length * 2);
for (byte b : a)
sb.append(String.format("%02x", b & 0xff));
return sb.toString();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK && data != null) {
filePaths = data.getStringArrayListExtra(FilePickerConst.KEY_SELECTED_MEDIA);
Spacecraft s;
ArrayList<Spacecraft> spacecrafts = new ArrayList<>();
//Uri filePath = data.getData();
try {
for (String path : filePaths) {
s = new Spacecraft();
s.setName(path.substring(path.lastIndexOf("/") + 1));
Log.v("image", path);
s.setUri(Uri.fromFile(new File(path)));
spacecrafts.add(s);
//bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), Uri.parse(path));
}
gv.setAdapter(new CustomAdapter(this, spacecrafts));
Toast.makeText(HomeScreen.this, "Total = " + String.valueOf(spacecrafts.size()), Toast.LENGTH_SHORT).show();
} catch (Exception e) {
e.printStackTrace();
}
imageString = filePaths.get(0);
Log.v("newimagestring",imageString);
imageString2 = filePaths.get(1);
Log.v("newimagestring",imageString2);
imageString3 = filePaths.get(2);
Log.v("newimagestring",imageString3);
File image1 = new File(imageString);
BitmapFactory.Options bmOptions1 = new BitmapFactory.Options();
Bitmap bitmap1 = BitmapFactory.decodeFile(image1.getAbsolutePath(),bmOptions1);
ByteArrayOutputStream stream1 = new ByteArrayOutputStream();
bitmap1.compress(Bitmap.CompressFormat.PNG, 100, stream1);
imageByteArray1 = stream1.toByteArray();
File image2 = new File(imageString2);
BitmapFactory.Options bmOptions2 = new BitmapFactory.Options();
Bitmap bitmap2 = BitmapFactory.decodeFile(image2.getAbsolutePath(),bmOptions2);
ByteArrayOutputStream stream2 = new ByteArrayOutputStream();
bitmap2.compress(Bitmap.CompressFormat.PNG, 100, stream2);
imageByteArray2 = stream2.toByteArray();
File image3 = new File(imageString3);
BitmapFactory.Options bmOptions = new BitmapFactory.Options();
Bitmap bitmap3 = BitmapFactory.decodeFile(image3.getAbsolutePath(),bmOptions);
ByteArrayOutputStream stream3 = new ByteArrayOutputStream();
bitmap3.compress(Bitmap.CompressFormat.PNG, 100, stream3);
imageByteArray3 = stream3.toByteArray();
}
}
This is the Response,
D/QcrilMsgTunnelSocket: Response ID 525295 is not served in this process. D/QcrilMsgTunnelSocket: Response ID 525295 is not served in this process. W/Analytics-Core-ConfigServer: HttpResponse is empty. W/Analytics-Core-ConfigServer: HttpResponse is empty. D/QcrilMsgTunnelSocket: Response ID 525295 is not served in this process. D/com.xiaomi.common.Network: Http POST Response Code: 503