Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Sensors on Android with React Native

I'm trying out React Native right now, and I'm wondering if it is possible to use the sensors (Accelerometer, Gyroscope, etc.) on Android, for I know it is possible on iOS.

This repo seems to have most resources involving React Native, but I cannot find one that specifically refers to using the sensors on Android. https://github.com/jondot/awesome-react-native

like image 447
Sean Saito Avatar asked Nov 02 '15 18:11

Sean Saito


2 Answers

To answer your question as to whether it's possible... yes, everything that is native is also possible with react native. You just might have to roll your own solution, especially now because react-native (especially for android) is so young.

I always check https://react.parts/native to see what components the community has created. I recommend this as your first stop as well.

I found this iOS only package there... https://github.com/pwmckenna/react-native-motion-manager

like image 67
Chris Geirman Avatar answered Sep 17 '22 23:09

Chris Geirman


I just wrote a package for Android: https://github.com/kprimice/react-native-sensor-manager

like image 27
Kevin P Avatar answered Sep 19 '22 23:09

Kevin P