<?xml version="1.0" encoding="utf-8"?>
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
        id="cordova-plugin-stepcounter"
        version="1.0.0">

  <name>Cordova Step Counter Plugin</name>

  <engines>
    <engine name="cordova" version=">=3.4.0"/>
  </engines>

  <asset src="www/stepcounter.js" target="js/stepcounter.js"/>

  <js-module src="www/stepcounter.js" name="stepcounter">
    <clobbers target="stepcounter" />
  </js-module>

  <platform name="android">

    <config-file target="AndroidManifest.xml" parent="/manifest/application">
        <service android:name="net.texh.cordovapluginstepcounter.StepCounterService" android:enabled="true" />

        <!--
             * This class is triggered upon reboot of the device. It needs to re-register
             * the STEP_COUNTER with the StepCounterService
             -->
        <receiver android:name="net.texh.cordovapluginstepcounter.StepCounterBootReceiver" >
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>
    </config-file>

    <config-file target="AndroidManifest.xml" parent="/manifest">
      <uses-feature android:name="android.hardware.sensor.stepcounter" />
      <uses-feature android:name="android.hardware.sensor.stepdetector" />
        <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    </config-file>

    <config-file target="res/xml/config.xml" parent="/*">
      <feature name="CordovaStepCounter">
        <param name="android-package" value="net.texh.cordovapluginstepcounter.CordovaStepCounter"/>
      </feature>
    </config-file>

    <source-file src="src/android/net/texh/cordovapluginstepcounter/CordovaStepCounter.java" target-dir="src/net/texh/cordovapluginstepcounter/"/>
    <source-file src="src/android/net/texh/cordovapluginstepcounter/StepCounterService.java" target-dir="src/net/texh/cordovapluginstepcounter/"/>
    <source-file src="src/android/net/texh/cordovapluginstepcounter/StepCounterBootReceiver.java" target-dir="src/net/texh/cordovapluginstepcounter/"/>
  </platform>

</plugin>
