Android 4.4 Step Detector and Counter

落花浮王杯 提交于 2019-11-27 02:42:31

问题


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.

I am planning to try my hands on these new concepts and want to use the API but there's nothing around it on the Internet.


回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/20367402/android-4-4-step-detector-and-counter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!