Sunday, 1 June 2014

Async Headache

Yesterday I tried to upload the submitted data to a spreadsheet. I got the Http Request file off StackOverflow. However five hours later I could not get it to work. The problem was,  from what I understand, that Android does not allow you to do anything that takes too long on the main thread.
They have this thing called AsyncTask which is supposed to help you handle multiple threads. However I found it hard to use. After I wrote the code for it for some reason I was unable to execute it. It kept asking me to pass in a variable although I had not defined it to take in any variables.
I scrapped my code for the AsyncTask and looked through GitHub for a ready made one. I found some code for uploading data to a spreadsheet. It does not appear to look AsyncTask, I hope it was not made for an older version of Android.
I will continue work on it on Wednesday now.

No comments:

Post a Comment