I'm in the process of developing an Android app, which uses HTTP POST to send login data to a server. This all worked fine, until both the HTTPClient and the NameValuePair libraries were deprecated in recent updates.
I've Google'd a lot for new methods, and I know I should use Http(s)URLConnection for connecting to a server, but I can't get it to work properly and the Google Developers site doesn't provide an example either. I did use this piece of code but it won't work, throwing all sorts of syntax errors (missing ;'s and such).
Is there anyone who can provide an example of a working HTTP(s) request? Both POST and JSON are fine, as I can easily adjust the PHP code to receive JSON objects. Thanks in advance!
Use volley. Here is a scratch for you how to use it.