Hi I am trying to send data via http POST request to Microsoft Azure IoT Central.
I made a small app with a click counter and am trying to send the count as data but nothing is appearing on IoT Central, when I tried in Postman it worked.
Glenda Karen wrote:Any ideas would be great, thanks so much!
I would start by not ignoring any exceptions which may get thrown in your onClick handler. At a minimum log the exception class name and message contents.
You are performing a network operation in a UI thread which could lead to the UI becoming unresponsive. Android throws a NetworkOnMainThreadException to remind you of this.
I'm not sure what the current best practice is for performing asynchronous HTTP. It was common to use AsyncTask, but it looks like that has been deprecated.