[JAVA] [Android] I made a pedometer app.

Pedometer

Create a pedometer with an Android application by implementing a filtering process called a low-pass filter.

1.First of all

1.1 Purpose

You will be able to develop using an acceleration sensor when creating an Android application. Create a pedometer using an accelerometer.

1.2 Technology / Concept used

Smartphones have a 3-axis accelerometer.

3-axis sensor

The number of steps is counted by using the increase / decrease in acceleration obtained from these acceleration sensors. However, since it is not known how the smartphone is held, it may not be possible to measure accurately with only one-axis acceleration. Therefore, we will measure the number of steps by using the increase / decrease of the following values that combine the accelerations of the three axes.

Composite value

When walking, the value obtained by combining the accelerations of the three axes is taken, and the number of times the maximum value obtained by combining the accelerations of the three axes is taken is counted as the number of steps.

Maximum count

Also, since the raw data obtained from the sensor contains noise that interferes with the step count calculation, remove the extra noise. A filtering process called a low-pass filter is performed so that the correct number of steps can be counted as much as possible. The low-pass filter is a process of removing high-frequency components and extracting only low-frequency components.

Low Bus Filter

2. Conclusion

2.1 Program used

See GitHub --See MainActivity.java --See activity_main.xml

2.2 Execution screen

This screen is displayed when you start the app.

Startup screen

This screen is displayed when you press the Start button

After pressing the Start button

In addition, when the Restart button is pressed, the number of steps can be initialized to 0 steps. You can stop the measurement once by pressing the Stop button.

Actually walk and measure

I actually walked and measured it. I walked 14 steps, but the measurement shows 16 steps. There was an error of two steps. There is room for improvement

Recommended Posts

[Android] I made a pedometer app.
I made a matching app (Android app)
I made a calculator app on Android
I made a rock-paper-scissors app with android
I made a chat app.
I made a rock-paper-scissors app with kotlin
I made an Android app for MiRm service
I made a viewer app that displays a PDF
I made a library for displaying tutorials on Android.
Ruby: I made a FizzBuzz program!
I made a GUI with Swing
I made a simple recommendation function.
I made a lock pattern using the volume key with the Android app. Fragment edition
I made a package.xml generation tool.
[Rails] I made a simple calendar mini app with customized specifications.
I tried to create a simple map app in Android Studio
I made a risky die with Ruby
I made a plugin for IntelliJ IDEA
I made a new Java deployment tool
I made a bulletin board using Docker 1
I have a question about Android studio.
Android weather app
I made StringUtils.isBlank
I made an app to scribble with PencilKit on a PDF file
I made a Diff tool for Java files
04. I made a front end with SpringBoot + Thymeleaf
I made a mosaic art with Pokemon images
I made an app for myself! (Reading management app)
I made a gender selection column with enum
I made a rock-paper-scissors game in Java (CLI)
I tried to create a LINE clone app
I made a Docker container to run Maven
[Rails] I made a draft function using enum
I made a LINE bot with Rails + heroku
I made a portfolio with Ruby On Rails
I made a simple graph library for smartphone apps [MP Android Chart Kai]
[Stajyun also admitted] I want a gourmet spy, but it costs 1103.3543 trillion yen, so I made an android app
I made a Docker image of SDAPS for Japanese
I tried using a database connection in Android development
I made a simple calculation problem game in Java
I made a check tool for the release module
I made a method to ask for Premium Friday
Android app Spectrum Analyzer
[Ruby] I made a crawler with anemone and nokogiri.
I got a cannot resolve symbol in Android Studio
I made a drawing chat "8bit paint chat" on WebAssembly
I made a Restful server and client in Spring.
I made a library that works like a Safari tab !!
I made a Wrapper that calls KNP from Java
I made an Android application that GETs with HTTP
About Android App Components
I made a Japanese version of Rails / devise automatic email
I made a server side of an online card game ⑤
I tried adding a separator line to TabLayout on Android
I made a development environment with rails6 + docker + postgreSQL + Materialize.
[Rails] I tried to create a mini app with FullCalendar
I want to push an app made with Rails 6 to GitHub
[Beginner] I made a program to sell cakes in Java
I made a server side of an online card game ⑥
[Beginner] android app that rolls a ball using a sensor [Java]
I tried JAX-RS and made a note of the procedure