DWorkSVolleyPlus

https://github.com/DWorkS/VolleyPlus
Go to Github

🏐 Volley library : make everything faster . Its an improvements for Volley by Google for Android https://android.googlesource.com/platform/frameworks/volley

https://github.com/DWorkS/VolleyPlus/issues/67Go to Github

FundedView inFile/String not uploading to server#67

AhmadullahSaikatcreated the issue about 2 months ago

private void sendCompanyInformationToServer() {

    SimpleMultiPartRequest smr = new SimpleMultiPartRequest(Request.Method.POST, User.ADD_COMPANY,
            new Response.Listener<String>() {
                @Override
                public void onResponse(String response) {
                    Log.d("Response", response);
                    try {
                        JSONObject jObj = new JSONObject(response);
                        String message = jObj.getString("message");

                        Toast.makeText(activity, message, Toast.LENGTH_LONG).show();

                    } catch (JSONException e) {
                        // JSON error
                        e.printStackTrace();
                        Toast.makeText(activity, "Json error: " + e.getMessage(), Toast.LENGTH_LONG).show();
                    }
                }
            },
            new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError error) {
                    handleError(error);
                }
            }) {
        @Override
        public Map<String, String> getHeaders() throws AuthFailureError {
            Map<String, String> headers = new HashMap<>();
            Log.d(LOG_TAG, "authorization token: " + authorization);
            headers.put(Constants.XREQUESTED_HEADER_KEY, Constants.XREQUESTED_HEADER_VALUE);
            headers.put(Constants.AUTHORIZATION_HEADER_KEY, "Bearer " + authorization);
            return headers;
        }

// @Override // protected Map<String, String> getParams() throws AuthFailureError { // Map<String, String> params = new HashMap<>(); // // params.put(User.TITLE, etOrganizationTitle.getText().toString()); // // params.put(User.PHONE, etOrganizationPhone.getText().toString()); // // params.put(User.ADDRESS, etOrganizationAddress.getText().toString()); // // params.put(User.LAT, lat); // // params.put(User.LNG, lng); // // Log.d(LOG_TAG, "Registration Token: " + authorization); // // return params; // }

    };

    smr.addStringParam(User.TITLE, etOrganizationTitle.getText().toString());

    smr.addStringParam(User.PHONE, etOrganizationPhone.getText().toString());

    smr.addStringParam(User.ADDRESS, etOrganizationAddress.getText().toString());

    smr.addStringParam(User.LAT, lat);

    smr.addStringParam(User.LNG, lng);

    smr.addFile(User.IMAGE, ProductActivity.imageFilePath);

    MyApp.getInstance().addToRequestQueue(smr);

}

Logs

  1. larrytech7stoped workingabout 2 months ago
  2. larrytech7started workingabout 2 months ago
  3. boostiofunded $5about 2 months ago

Total Fund

$5

You will get $3.5 when resolving this issue

Funded by

1

Work status

No one is working