Just quickly glancing through the code, I believe your problem is here:
upLoadServerUri = "motionsense.uphero.com/public_html/motiondata/UploadToServer.php";
Basically you're trying to make a connection to UploadToServer.php through this public_html directory, however, this directory doesn't exist publically (it's where your "root" files are served from when accessing a website with '/'). Change to:
upLoadServerUri = "motionsense.uphero.com/motiondata/UploadToServer.php";
And you should be fine (assuming everything else works haha).