Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
React Visibility Sensor | 2,198 | 477 | 220 | a year ago | 53 | July 25, 2019 | 77 | mit | JavaScript | |
Sensor component for React that notifies you when it goes in or out of the window viewport. | ||||||||||
Reactivemaps | 936 | a year ago | 32 | JavaScript | ||||||
A data aware UI components library for building realtime maps | ||||||||||
React Native Sensors | 835 | 38 | 12 | 8 days ago | 75 | February 04, 2022 | 34 | mit | Objective-C | |
A developer friendly approach for sensors in React Native | ||||||||||
Automated Irrigation System | 558 | 8 months ago | 9 | JavaScript | ||||||
This is the software of an open source automated irrigation system. The complete setup including hardware can be found in the README. | ||||||||||
React Native Sensor Manager | 200 | 30 | 4 years ago | 11 | September 23, 2016 | 24 | Java | |||
Native sensors access for react-native | ||||||||||
React Native Proximity | 196 | 4 years ago | 7 | December 15, 2017 | 11 | mit | Java | |||
:iphone: A React Native wrapper that provides access to the proximity sensor on iOS and Android. | ||||||||||
Aws Appsync Iot Core Realtime Dashboard | 89 | 5 months ago | 1 | mit-0 | JavaScript | |||||
This sample application demonstrates a React based web dashboard receiving real-time updates from IoT sensors. The solution is built with AWS AppSync, AWS Amplify, Amazon Location Service, and AWS IoT Core technologies. | ||||||||||
Airqmon | 87 | 3 months ago | apache-2.0 | TypeScript | ||||||
A macOS menu bar application that displays live air quality data from the nearest sensor station. | ||||||||||
Pierosavi Imageit Panel | 74 | a year ago | 20 | apache-2.0 | TypeScript | |||||
Grafana Panel Plugin. Allows Measurement Values to be Overlaid on top of a Picture | ||||||||||
Visibility Sensor React Native | 61 | 6 months ago | 1 | November 09, 2020 | 6 | TypeScript | ||||
React Native component that helps with determining whether a component is in the viewport. |
Wrapper for react-native. Accelerometer, Gyroscope, Magnetometer, Orientation, Step Counter, Thermometer, LightSensor, and Proximity Sensor are supported for now.
$ npm i react-native-sensor-manager --save
rnpm
rnpm link
nrpm link
)Make alterations to the following files:
android/settings.gradle
...
include ':react-native-sensor-manager'
project(':react-native-sensor-manager').projectDir = new File(settingsDir, '../node_modules/react-native-sensor-manager/android')
android/app/build.gradle
...
dependencies {
...
compile project(':react-native-sensor-manager')
}
register module (in MainApplication.java)
cat ./node_modules/react-native/package.json | grep version
)import com.sensormanager.SensorManagerPackage; // <------ add package
public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
......
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mReactRootView = new ReactRootView(this);
mReactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setBundleAssetName("index.android.bundle")
.setJSMainModuleName("index.android")
.addPackage(new MainReactPackage())
.addPackage(new SensorManagerPackage()) // <------- add package
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();
mReactRootView.startReactApplication(mReactInstanceManager, "ExampleRN", null);
setContentView(mReactRootView);
}
......
}
import com.sensormanager.SensorManagerPackage; // <------ add package
public class MainApplication extends Application implements ReactApplication {
// ...
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(), // <---- add comma
new SensorManagerPackage() // <---------- add package
);
}
import React, {
DeviceEventEmitter // will emit events that you can listen to
} from 'react-native';
import { SensorManager } from 'NativeModules';
SensorManager.startAccelerometer(100); // To start the accelerometer with a minimum delay of 100ms between events.
DeviceEventEmitter.addListener('Accelerometer', function (data) {
/**
* data.x
* data.y
* data.z
**/
});
SensorManager.stopAccelerometer();
DeviceEventEmitter.addListener('Gyroscope', function (data) {
/**
* data.x
* data.y
* data.z
**/
});
SensorManager.startGyroscope(100);
SensorManager.stopGyroscope();
SensorManager.startMagnetometer(100);
DeviceEventEmitter.addListener('Magnetometer', function (data) {
/**
* data.x
* data.y
* data.z
**/
});
SensorManager.stopMagnetometer();
SensorManager.startOrientation(100);
DeviceEventEmitter.addListener('Orientation', function (data) {
/**
* data.azimuth
* data.pitch
* data.roll
**/
});
SensorManager.stopOrientation();
SensorManager.startStepCounter(1000);
DeviceEventEmitter.addListener('StepCounter', function (data) {
/**
* data.steps
**/
});
SensorManager.stopStepCounter();
SensorManager.startThermometer(1000);
DeviceEventEmitter.addListener('Thermometer', function (data) {
/**
* data.temp
**/
});
SensorManager.stopThermometer();
SensorManager.startLightSensor(100);
DeviceEventEmitter.addListener('LightSensor', function (data) {
/**
* data.light
**/
});
SensorManager.stopLightSensor();
SensorManager.startProximity(100);
DeviceEventEmitter.addListener('Proximity', function (data) {
/**
* data.isNear: [Boolean] A flag representing whether something is near the screen.
* data.value: [Number] The raw value returned by the sensor (usually distance in cm).
* data.maxRange: [Number] The maximum range of the sensor.
**/
});
SensorManager.stopProximity();