0
HttpPost post = new HttpPost("http://www.tree.com/action.php?fun=login");
List<NameValuePairs> Params= new ArrayList<NameValuePairs>();
Params.add(new BasicNameValuePair("username",username));
Post.setEntity(UrlEncodedFormEntity(Params));

I am unable to understand the concept of using new BasicNameValuePair("username",username). Does it relate to the ArrayList index? What is the advantage of using it?

Celeo
  • 5,583
  • 8
  • 39
  • 41
Abdalla Maged
  • 55
  • 1
  • 6

1 Answers1

0

NameValuePairs is like associative array. The operations are not made by integer indexes, they are made by Strings. They look something like this

"One"->"Value1"
"Two"->"Value2"
"Three"->"Value3"
Mayank
  • 1,364
  • 1
  • 15
  • 29