I have a function to read JSON from a web service:
public String readJSONFeed(String URL, String userName, String password){
...
List<NameValuePair> params = new ArrayList<NameValuePair>(2);
params.add(new BasicNameValuePair("userName", userName));
params.add(new BasicNameValuePair("password", password));
...
}
And I call it from an AsyncTask:
EditText userName = (EditText)findViewById(R.id.txtUserName);
EditText password = (EditText)findViewById(R.id.passWord);
return readJSONFeed("http://service.com/service.php", userName.getText().toString(), password.getText().toString());
My question is how can make the readJsonFeed generic and have it parse an array into name value pairs.