Stream realtime data from Android or iPhone JavaScript?
I would like to stream rea开发者_运维问答ltime accelerometer data from a smartphone (preferably iPhone or Android, but I'm mostly platform agnostic) to a JavaScript app running in the client's browser. I want to send updates as rapidly as the phone will give me readings from the device.
What is the best way to do this? Could I set up a web server on the phone, then connect to it from JavaScript with web sockets?
I believe the easiest way to achieve this is to use a cross-platform api such as phonegap. See the supported native feature list here: http://www.phonegap.com/about/features
Maybe it's to late :) but its for further searchs.
Did you have a look into this link: http://www.muzzley.com/documentation/components/motion-sensor.html
Basically what you just need to worry is to do your html/javascript app. The rest is already done :)
I hope it helps.
精彩评论