Is there any alternative to send request parameters through android other than NameValuePair. I'm trying to send arraylist as request parameter, but NameValuePair accepts only string value.
-
1add more details including code you have written till now.Piyush-Ask Any Difference– Piyush-Ask Any Difference2013-04-25 08:00:38 +00:00Commented Apr 25, 2013 at 8:00
Add a comment
|
3 Answers
You may consider sending the ArrayList as JSONArray.
Check this SO post.
convert ArrayList<MyCustomClass> to JSONArray
Convert normal Java Array or ArrayList to Json Array in android
Comments
Store arraylist in to a string and then send it..
ArrayList<String> contactlist=new ArrayList<String>();
contactlist.add("Android");
contactlist.add("tarnaka");
contactlist.add("uppal");
contactlist.add("Prasad");
String[] contact=new String[contactlist.size()];
contact=contactlist.toArray(contact);