10

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

Sean Saito
  • 655
  • 7
  • 18
  • 1
    There is also [react-native-sensors](https://github.com/react-native-sensors/react-native-sensors), which seems to raise on the shoulders of the packages mentioned. – milkersarac Mar 17 '17 at 14:34

2 Answers2

7

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

Kevin P
  • 273
  • 1
  • 3
  • 13
  • First of all, thank you for taking time to develop this but there seems to be bugs with it. No one was successful with this library. – Azmeer Nov 19 '17 at 16:02
  • I published the library a long time ago and I have to say that I didn't really have time to maintain it (I actually don't use react native anymore). Sorry about that – Kevin P Nov 20 '17 at 16:53
4

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

Chris Geirman
  • 9,474
  • 5
  • 37
  • 70