react-native-weward-android-pedometer
v1.0.6
Published
Native pedometer for Android. Running on background.
Downloads
4
Readme
react-native-weward-android-pedometer
Getting started
$ npm install react-native-weward-android-pedometer --save
Mostly automatic installation
$ react-native link react-native-weward-android-pedometer
Manual installation
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.weward.pedometer.RNWewardAndroidPedometerPackage;
to the imports at the top of the file - Add
new RNWewardAndroidPedometerPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-weward-android-pedometer' project(':react-native-weward-android-pedometer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-weward-android-pedometer/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-weward-android-pedometer')
Usage
import RNWewardAndroidPedometer from 'react-native-weward-android-pedometer';
//Starts step service
RNWewardAndroidPedometer.startStepService();
//Stops step service
RNWewardAndroidPedometer.stopStepService();