0

I've just started coding something for Google Glass. While I have experience with Java, I'm totally new to Android development as well as how server-type stuff works. I need to send a photo taken with Google Glass to a python script someone's hosting online and then retrieve an outputted JSON file from that script. On a computer, if you go to the URL of the python script with an image URL, it seems to work (http://blahblah.com/cgi-bin/blahblah.py?url=http://blahblah.com/blah.jpg gives back information from a JSON). How can I do this with Glass / Android? I tried using HttpURLConnection and POSTing the data but it couldn't establish a connection.

Thanks!!

choupettes
  • 31
  • 4

1 Answers1

0

It turns out my problem was that I was doing it all in my main Activity, while Android apps require that URLConnections be established in another thread. So I solved this by making a separate AsyncTask to handle the upload.

choupettes
  • 31
  • 4