I been following online tutorials on how to insert data into a database from an android app and have everything working except this small part
List
you can use contentvalues or hashmap based on your preference.
i have used Content values
ContentValues contentValues = new ContentValues();
contentValues.put("key1","value1");
contentValues.put("key2","value2");
and if the data that u are posting is form data then here`s how u can convert it form data
public String getFormData(ContentValues contentValues) throws UnsupportedEncodingException {
StringBuilder sb = new StringBuilder();
boolean first = true;
for (Map.Entry entry : contentValues.valueSet()) {
if (first)
first = false;
else
sb.append("&");
sb.append(URLEncoder.encode(entry.getKey(), "UTF-8"));
sb.append("=");
sb.append(URLEncoder.encode(entry.getValue().toString(), "UTF-8"));
}
return sb.toString();
}