3

Hi i am new for android and in my app i have listview and in this listview each row having multiple images

I have to send all this images to server using Volley library for this i serched lot in internet that is how to send listview ArryList images to server but i din't find any result

i have find some from stackOverflow but which is not suitable for sending ArryList images to server can any one help me please

Uploading multiple images with volley?

my main class

//Auth header
Map<String, String> mHeaderPart= new HashMap<>();
mHeaderPart.put("Content-type", "multipart/form-data;");
mHeaderPart.put("access_token", accessToken);

//File part
Map<String, File> mFilePartData= new HashMap<>();
mFilePartData.put("file", new File(mFilePath));
mFilePartData.put("file", new File(mFilePath));

//String part
Map<String, String> mStringPart= new HashMap<>();
mStringPart.put("profile_id","1");
mStringPart.put("imageType", "ProfileImage");

CustomMultipartRequest mCustomRequest = new CustomMultipartRequest(method, mContext, url, new Response.Listener<JSONObject>() {
            @Override
            public void onResponse(JSONObject jsonObject) {
                listener.onResponse(jsonObject);
            }
        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError volleyError) {
                listener.onErrorResponse(volleyError);
            }
        }, mFilePartData, mStringPart, mHeaderPart);
Community
  • 1
  • 1
AbhiRam
  • 2,033
  • 7
  • 41
  • 94
  • I know that you asked about Volley, but I think that is better to use [Retrofit 2](http://square.github.io/retrofit/) for this purpose. It's easier and Retrofit have support. – MrOnyszko Aug 16 '16 at 16:29
  • no no i have to use Volley library – AbhiRam Aug 16 '16 at 16:32
  • You'll need to provide more details about what you are seeing (or not seeing), logcat output, server output, and possibly more code before anyone will be able to offer up help. – Larry Schiefer Aug 16 '16 at 16:42

0 Answers0