Dear Kathryn,
I am sorry if this didn't work for you. I am attaching the code that works for me and some students of mine. I am very sorry for not annotating it correctly, but I need to prepare a presentation for tomorrow and wanted to reply as swiftly as possible. I ran this piece of code on a couple of independent OSX machines and it appears to be working fine on all of them. I tested it on everything from iPhone 4 to iPhone 6. You are saying that you ran it in the Cloud, which I did not do. I ran it on a local machine, and laptop and iPhone were in the same network. I have not used the Wolfram Cloud app, but an iOS app from the app store that is called "Sensor Data". I think that it is expected that it will not work in the Cloud/Wolfram Development platform.
I just ran that code on MMA10.3 on OSX.
Note that when I run it, there are several functions in blue (e.g. setSoTimeout[10], receive, getData[]) but InstallJava[], LoadJavaClass[], JavaNew[] are black. Here's a screenshot.
As you work at Wolfram I suppose that you also are running MMA10.3. Which operating system are you using?
I have asked a colleague of mine at our institute to post his code, which is a self-written code for Androids.
I think that it would be possible to make this "work" in the cloud. If you use, for example, DataDrop you can achieve something similar, with the exception that the update rate of data drop is nominally 2 Hz, so you would not be much faster than that.
If you cannot make it work I would be happy to screen-share and demonstrate how the program works.
Best wishes from Aberdeen,
Marco
Attachments: