Stream realtime data from Android or iPhone JavaScript? - javascript

I would like to stream realtime 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.

Related

opencv,node.js and android communication

I have developed a program which detects human in real time(webcam) and displays it to the webpage of the local network. This is done by creating a server and websockets using Node.js and opencv.
Now, I have to develop an android app where i should get a notification everytime when the human is detected from the webcam video of a local host. How can i achieve this using node.js server and android interfacing?
Any suggestions or inputs with code examples would be more helpful.
Try using ionic to convert between webpages and android. Then use push notifications to alert the user.

File transfer in phonegap using bluetooth

i am new to phonegap, i would like to know is that possible to transfer text file from one device to another device using bluetooth in phonegap. i have gone through many example but i couldn't find any relevant answer to this.
I had seen few example which can detect nearest bluetooth devices but not about file transfer using bluetooth. Does anyone have any ideas? Thanks in advance
I'm assuming it is possible with bluetooth, but I haven't seen any examples. I'm trying to do the same thing. Also, none of the cordova bluetooth plugins I've seen support Android, IOS, Windows Phone 8.x and Windows 8.x

communcation between node.js and processing

i'am working on a project where i receive data from mobile phones via websockets to a node.js server using socket.io. and this i want to pass to processing. The processing sketch is not running in the browser, it manage sounds, arduino, ... so i wonder what would be a good protocool to send the data to the processing sketch?
I did not found a way to use socket.io in processing, so i thought about using osc?
Or is there a other socket protocoll i can use between mobile phones, node, processing?
thanks!
See if this shield will do the trick for you: http://arduino.cc/en/Main/ArduinoEthernetShield Found a few simple projects from google that seem to fit your description of what you want (turn something on/off from the web).
Node can be your server, with sockets.io, and node can most likely communicate over the web with this shield. Note: I've never used it, just googled, saw a project that looks like what you are interested in.
EDIT: Here is another possible solution: http://xseignard.github.io/2013/06/25/interfacing-leap-motion-with-arduino-thanks-to-nodejs/ using: https://github.com/rwaldron/johnny-five

Monitoring the displacement of a mobile device using GPS

I am wanting to develop an application for mobile devices, which shows in real time where a user (with this software installed on your mobile device) is. The idea would be that one (or more) users could follow the map the displacement of another user via GPS. I want to use PhoneGap with HTML5 and CSS and Javascript.
My question is: Is it possible to do that with these technologies? If yes, where can I get information of how to handle the GPS that way? If you can not, which language would give me this possibility and where can I get information? At first, I intend to develop this Application for Android and IOS.
Yes it’s very much possible with PhoneGap technology. You have to write a web service to keep the GPS coordinates as user updates (or auto updates) in server. You can let other users to connect to Web service and get the info they wanted (i.e. the data they wanted to see the current location of the user). You developed using PhoneGap means, it’ll work for iPhone too.
You can easily develop a web service either using PHP, Java or C# though C# web services are easy to write and maintain but PHP web servers are cheap compare to windows hosting (which you will need to host C# web service).
The question you asked is very broad so can write a 1000 words article and beyond. If you ask specific question I can answer that.

Get a tablets(iPad or Droid) mac address?

Synopsis: I am developing a HTML5 web app that will allow tablets(iPad or Droid) to login to a server and perform various functions. The client would like a way to check the devices mac address when logging in. From what I have read, most solutions use activex objects that will not work for webkit browsers.
Question: Does anyone know a solution that would hook into a HTML5 web app seamlessly(Idealy update a hidden form element with the value upon logging in)?
Thanks!
I don't think there's going to be a straightforward way to do this. The web server won't be exposed to a client's MAC address unless they're on the same physical segment...you'll only see the MAC from the most recent router hop in general.
If anything exists, it's going to be a browser plugin (show-stopper on iOS). And it would probably need more than the default permissions available (I don't suspect you can enumerate network interfaces in Java, for example, without asking for elevated permissions).
If you're looking for HTML/JS only then I don't think that this is possible. It won't be exposed.
The problem is that the packets you recieve back will only contain the MAC address of the node on the last hop.
This may be possible via a plugin, but then this limits you on iOS, and possibly also Android as you'd need to provide them a way of getting the plugin first (unless you used a plugin that was installed by default).
Edit: Not that I support an app for every little thing, but it shows that easy to press app buttons sometimes tend to do better than web apps (regardless of being able to make browser shortcuts to home screens). If it is suitable, you could consider loading this within a web view on the target device from within an app, from which you can then of course access MAC addresses and whatever else you may need.
MobiThinking: Mobile applications: native v Web apps – what are the pros and cons?
Forbes: Mobile Web App vs. Native App? It's Complicated

Categories