I am still fumbling through Android, today, in trying to create an AsyncTask to connect to a website, post some data, and get a response. My understanding is that i must use an AsyncTask here, as the main
thread is not allowed to do this sort of work. And, iiuc, AsyncTask threads are not available for debugging with the Studio debugger.
The log shows "1" then "exception," as it fails on connection.getOutputStream(). I have verified it is that specific method by splitting up the statement, and setting connection.getOutputStream() to an interim variable in it's own line of code.
How to determine what the error is?