Android 4.4 Step Detector and Counter

后端 未结 2 1836
孤街浪徒
孤街浪徒 2020-12-09 18:11

Is there any documentation around Android 4.4 KitKat\'s (well specifically Nexus 5 for now) step detector and counter APIs? I tried to search a lot but did not find anything

相关标签:
2条回答
  • 2020-12-09 18:44

    I found an example for you, hope it helps in someway, the sensor explanation on the API page is pretty straight forward too..

    API Page: http://developer.android.com/about/versions/android-4.4.html#UserInput

    Blog Post: http://theelfismike.wordpress.com/2013/11/10/android-4-4-kitkat-step-detector-code/ Github Project referenced in the blog: https://github.com/theelfismike/android-step-counter

    0 讨论(0)
  • 2020-12-09 18:44

    Official example

    In Android SDK 23 under samples/android-23/sensors/BatchStepSensor, run with:

    ./gradlew clean
    ./gradlew assembleDebug
    ./gradlew installDebug
    

    Then turn on the app, enable one of the step sensors, and walk around with your phone to see the counter increment.

    Source at: https://github.com/googlesamples/android-BatchStepSensor

    0 讨论(0)
提交回复
热议问题