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<NameValuePair> params = new ArrayList<>();
params.add(new BasicNameValuePair("username", username));
params.add(new BasicNameValuePair("password", password));
NameValuePair and BasicNameValuePair have been deprecated in favor of openConnection()
. How can I create a new-value association with that? http://developer.android.com/reference/java/net/URL.html#openConnection()
Does anyone know how I can create name value pairs with openConnection? I been searching everywhere.
ContentValues
has been design in order to be used by contentresolver NOT network communications - which the question is based on - since there is nogetName()
andgetValue()
methods in case you need to parse header attributes. – Conventionalism