My company uses ODK Collect for data collection, however we have a certain type of data that can't be easily collected using ODK. I've developed an app with a more suitable UI and I'd like to be able to upload its data to our Aggregate server. The thinking is that I'll create a form with the appropriate data structure, load it onto our Aggregate server, then in the app generate an XML file for each piece of recorded data.
I'm new to Android development so I've been go through the source code of ODK Collect in the hopes of reverse engineering how it handles uploading to Aggregate. I seem to have run into a brick wall however, no matter what I do my connection to the server is refused. I figure it must be my code because the login settings are identical to what would be supplied in ODK Collect. Would someone mind looking over the code in question and giving me a few pointers? PasteBin below: