• Home
Name Date Size #Lines LOC

..--

.google/03-May-2024-2015

Application/03-May-2024-4,5302,391

gradle/wrapper/03-May-2024-76

screenshots/03-May-2024-

CONTRIB.mdD03-May-20241.6 KiB3627

CONTRIBUTING.mdD03-May-20241.5 KiB3627

LICENSED03-May-202411.1 KiB202169

NOTICED03-May-2024613 1611

README.mdD03-May-20243.1 KiB7956

build.gradleD03-May-202414 150

gradlewD03-May-20245 KiB165122

gradlew.batD03-May-20242.3 KiB9166

packaging.yamlD03-May-2024471 1610

settings.gradleD03-May-202422 21

README.md

1Android BatchStepSensor Sample
2===================================
3
4Sample demonstrating how to set up SensorEventListeners for step
5detectors and step counters.
6
7Introduction
8------------
9
10This sample demonstrates the use of the two step [sensors][1] (step detector and counter) and
11sensor batching.
12
13It shows how to register a [SensorEventListener][2] with and without
14batching and shows how these events are received.
15
16The Step Detector sensor fires an
17event when a step is detected, while the step counter returns the total number of
18steps since a listener was first registered for this sensor.
19
20Both sensors only count steps while a listener is registered. This sample only covers the
21basic case, where a listener is only registered while the app is running. Likewise,
22batched sensors can be used in the background (when the CPU is suspended), which
23requires manually flushing the [sensor event][3] queue before it overflows, which is not
24covered in this sample.
25
26[1]: https://developer.android.com/reference/android/hardware/Sensor.html
27[2]: https://developer.android.com/reference/android/hardware/SensorEventListener.html
28[3]: https://developer.android.com/reference/android/hardware/SensorEvent.html
29
30Pre-requisites
31--------------
32
33- Android SDK v21
34- Android Build Tools v21.1.1
35- Android Support Repository
36
37Screenshots
38-------------
39
40<img src="screenshots/screenshot1.png" height="400" alt="Screenshot"/> <img src="screenshots/screenshot2.png" height="400" alt="Screenshot"/> <img src="screenshots/screenshot3.png" height="400" alt="Screenshot"/> <img src="screenshots/screenshot4.png" height="400" alt="Screenshot"/> <img src="screenshots/screenshot5.png" height="400" alt="Screenshot"/> <img src="screenshots/screenshot6.png" height="400" alt="Screenshot"/>
41
42Getting Started
43---------------
44
45This sample uses the Gradle build system. To build this project, use the
46"gradlew build" command or use "Import Project" in Android Studio.
47
48Support
49-------
50
51- Google+ Community: https://plus.google.com/communities/105153134372062985968
52- Stack Overflow: http://stackoverflow.com/questions/tagged/android
53
54If you've found an error in this sample, please file an issue:
55https://github.com/googlesamples/android-BatchStepSensor
56
57Patches are encouraged, and may be submitted by forking this project and
58submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
59
60License
61-------
62
63Copyright 2014 The Android Open Source Project, Inc.
64
65Licensed to the Apache Software Foundation (ASF) under one or more contributor
66license agreements.  See the NOTICE file distributed with this work for
67additional information regarding copyright ownership.  The ASF licenses this
68file to you under the Apache License, Version 2.0 (the "License"); you may not
69use this file except in compliance with the License.  You may obtain a copy of
70the License at
71
72http://www.apache.org/licenses/LICENSE-2.0
73
74Unless required by applicable law or agreed to in writing, software
75distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
76WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
77License for the specific language governing permissions and limitations under
78the License.
79