This an example implementation of a basic react native module that reads acceleration sensor data.
When the whole project is up and running you can see the acceleration sensor data produced by the smartphone in a browser real time.
The communication of the clients is done with websockets.
sensors-module
- a react native module that reads the acceleration sensor data
client
- a react native mobile app that utilizes the sensors-module
and transmits that data to the socker-server
socket-server
- a websocket server that receives the acceleration sensor data and re-trasmits it to the rest of the connected clients
web-app
- a react app that listens to socket-server
for acceleration sensor data and displays it by utilizing <canvas />
Only the Android version is implemented. Also it is implemented in a very basic manner because of lack of time.
Android device connected to localhost and setup to work with adb
Free ports on localhost: 4000
, 3000
, 8081
.
./prepare.sh
./start.sh
By now you should get the "native sensors graphs client" mobile app opened automatically on your Android device.
Also a browser window pointing to http://localhost:3000/
should have been opened automatically.
Once both client get connected, you should see 3 graphical bars scaling up and down in the browser window.