Skip to content

A fitness app that helps you get into better shape by monitoring the distance walked.

Notifications You must be signed in to change notification settings

marceand/HPIFitness

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

HPIFitness app

Create simple fitness app for Android with the following requirements:

  • Support different users with user credentials (username and password)
  • Get and store locally the distance walked
  • Feedback on achieving milestones (multiples of 1000 feet)
  • Whenever the person is at office, periodic reminder to stand up and walk every 1 hour.
  • Display daily statistics (in text format) on the main-screen.

#Library for Solution
To measure and save user's distance walked, I applied the following libraries:

  • Butter Knife - Bind view to class member fields
  • Realm - Faster and easier-to-use Local database for authentication and persisting user's walk data.
  • Google Play Service - Provide library for getting access to Google Map and user location

Failed Attempt

  • Google Fit-Tried to use Google fit API to get precise user's steps, and distance walked but data from sensors did not change after many testing. Therefore decided to take advantage of user GPS and Google map.

Challenge and Learning

  • Due to Android activity lifecycle, the distance walked can not be record in the main screen. Therefore a service is created in the background to record the distance and time walked. It is very difficult to maintain a service in the background because the Android system could kill it to claim memory and power usage. The best practice is binding the service to the main screen, and running it in the foreground with a notification.
  • The distance walked is not precise because the Android location service provides location at different interval and the errors increase drastically. For this app, I measure the distance walked by adding consecutively the distance between the current and previous location.
  • The best user experience is letting the user to control the reminder, therefore I let the user turn on and off the notification
  • For authentication, the best practice is not to save user information (username and password on the phone) because there is the risk that it will be found.

To-Do

  • Drawing user's path on Google map still has to be done.

Android Version

  • 5.0 Lollipop - 6.0 Marshmallow

Warning

  • Turn on GPS after installation

Screenshot for final app

Alt text

Alt text

Alt text

Alt text

Alt text

Alt text

Steps Follow to Complete App

  1. Create a repository for the app to record my work process, results from research
  2. Do research about the best way of getting user distance walked. Result from search:
  1. Wireframing based on the requirements and result from research
  1. Sketch a diagram for the architecture of the app
    Alt text
  2. Create an application in Android Studio: create different branch for every major requirement.
  3. First branch: Google map service connection:
  • Create a map activity
  • Connect to google service by registering the app in Google developer console
  1. Second branch: Create a location service
  • Get location using Location API in service
  • Calculate distance and time in Service
  • Connect service to map activity
  1. Third Branch: create authentication
  • Create log in layout
  • Create Sign up layout
  1. Fourth Branch: Create authentication to Realm database
  • Connect Log in to database
  • Connect Sign up to database
  1. Fifth Branch: Create main screen
    • Create logout
  • Display main statistic
  • Create notification for every 1 hour
  1. Sixth Branch: Connect Main screen to walk screen
  • Follow Activity lifecycle for updating main screen
  • Save user walk data in Realm databases
  1. Last Branch: improve UI, and refactoring
  • Change UI colors
  • Check code for refactoring and naming convention
  • Checks requirements

About

A fitness app that helps you get into better shape by monitoring the distance walked.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages