GithubHelp home page GithubHelp logo

sjaramillo10 / pedometer Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 1.31 MB

Lightweight (and MAD) Pedometer app for Android using the hardware step sensor to track your steps without being tracked.

License: Apache License 2.0

Kotlin 100.00%
android android-app pedometer kotlin mad

pedometer's Introduction

Pedometer

WIP

Acknowledgements

This project was forked from https://github.com/j4velin/Pedometer. I asked GitHub support to detach this from the parent repo, because my intention is to continue making changes and publish it to the Play Store.

pedometer's People

Contributors

alfonsorr avatar alonsolp avatar alvarogzp avatar anthonytex avatar avandorp avatar dbf256 avatar devpilot avatar dotwee avatar felix2yu avatar i3ck avatar j4velin avatar kazuh avatar mcgivergim avatar naofum avatar naxa777 avatar newjorg avatar nikanorov avatar ogr3 avatar oxidfox avatar renovate[bot] avatar saraiva1989 avatar sjaramillo10 avatar stankochetkov avatar sweetlion avatar victorenator avatar yoasif avatar zenoven avatar zygimantus avatar

Stargazers

 avatar  avatar

Watchers

 avatar

pedometer's Issues

Make worker notification silent.

The StepsWorkManager runs a process that creates a notification every 15 minutes. We don't want this notification to alert the user or produce a sound.

Introduce 'Stats' tab to MainActivity with Compose. โœจ

Introduce the new 'Stats' tab in between 'Home' and 'Settings'. This new tab will initially contain the information available in the StatisticsDialog, but the fun part is of course, that it will use Jetpack Compose ๐Ÿ˜.

Screenshot of the current StatisticsDialog:

Update targetSdk/compileSdk to 31.

The current targetSdk/compileSdk is 30, but several of the latest libraries (AppCompat, ViewModel, WorkManager, Material Components, etc.) require targetSdk/compileSdk 31. Check #14 out for some complications with WorkManager.

Use day as id in the steps db table

The app is currently using the milliseconds since January 1st, 1970 as the id for the steps table. This is problematic because the milliseconds since that date are different for different time zones. Also, we don't need that much granularity, because the app is only interested in tracking and showing the steps on a daily basis.

For that reason, using the day number since January 1st, 1970 is good enough.

Introduce HomeViewModel that provides HomeUiState.

The HomeFragment is currently obtaining the data it requires directly from the repository and in the Main dispatcher.

Instead of doing it this way, we should introduce a HomeViewModel that provides all the information HomeFragment requires in the form of a HomeUiState.

Consider re-adding the Widget functionality

In order to simplify the code, and facilitate the migration to Kotlin and Jetpack Compose, the already existing Widget code was deleted. Consider re-implementing the functionality in the future in case it provides enough value.

Fix CSV import issue

There is an issue with the CSV import feature, because it adds the current count since last boot time to today's count.

Introduce circular reveal animation when switching theme.

The circular reveal animation when switching the theme was introduced to the Android world by the guys at Telegram. That transition looks great and it would be awesome to get my hands dirty trying to implement it here.

The Telegram Android app is open source and this blogpost breaks down how that animation is accomplished.

Migrate SensorListener service functionality to WorkManager

Pedometer currently uses the SensorListener service to listen to SensorManager updates, however this is very inefficient, because it attempts to keep on listening all the time.

This post suggests using JobScheduler instead to query for the steps count every few minutes (every 15 minutes for example).

JobScheduler however, is a system specific library, and is available on Android API 23+ only. For that reason, the app should be migrated to use Jetpack's WorkManager instead.

Integrate Timber for logging

Timber is a small and cool library that is helpful to log data.

Currently the app is trying to log data to a file in Logger#log(String), but that fails and is probably no longer a good practice.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency androidx.preference:preference-ktx to v1.2.1
  • Update androidx.hilt to v1.2.0 (androidx.hilt:hilt-compiler, androidx.hilt:hilt-work)
  • Update dependency androidx.appcompat:appcompat to v1.7.0
  • Update dependency androidx.arch.core:core-testing to v2.2.0
  • Update dependency com.android.tools.build:gradle to v7.4.2
  • Update dependency com.google.android.material:compose-theme-adapter to v1.2.1
  • Update dependency org.jetbrains.kotlin:kotlin-gradle-plugin to v1.9.25
  • Update hilt to v2.52 (com.google.dagger:hilt-android-testing, com.google.dagger:hilt-android-gradle-plugin, com.google.dagger:hilt-compiler, com.google.dagger:hilt-android)
  • Update room to v2.6.1 (androidx.room:room-runtime, androidx.room:room-ktx, androidx.room:room-compiler)
  • Update work to v2.9.1 (androidx.work:work-testing, androidx.work:work-runtime-ktx)
  • Update actions/checkout action to v4
  • Update actions/setup-java action to v4
  • Update dependency com.android.tools.build:gradle to v8
  • Update dependency com.android.tools:desugar_jdk_libs to v2
  • Update dependency gradle to v8
  • Update dependency org.jetbrains.kotlin:kotlin-gradle-plugin to v2
  • Update dependency org.jlleitschuh.gradle.ktlint to v12
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/android.yml
  • actions/checkout v3
  • actions/setup-java v3
  • actions/checkout v3
  • actions/setup-java v3
gradle
gradle.properties
settings.gradle.kts
build.gradle.kts
app/build.gradle.kts
  • com.android.tools:desugar_jdk_libs 1.1.5
gradle/libs.versions.toml
  • androidx.activity:activity-compose 1.4.0
  • androidx.activity:activity-ktx 1.4.0
  • com.android.tools.build:gradle 7.2.0
  • androidx.hilt:hilt-work 1.0.0
  • androidx.hilt:hilt-compiler 1.0.0
  • androidx.test.ext:junit 1.1.3
  • androidx.test:rules 1.4.0
  • androidx.test:runner 1.4.0
  • androidx.appcompat:appcompat 1.4.2
  • androidx.compose.foundation:foundation 1.1.1
  • androidx.compose.material:material 1.1.1
  • com.google.android.material:compose-theme-adapter 1.1.5
  • androidx.compose.ui:ui-test-junit4 1.1.1
  • androidx.compose.ui:ui-tooling 1.1.1
  • androidx.arch.core:core-testing 2.1.0
  • com.github.j4velin.EazeGraph:EazeGraph 1.0.3
  • androidx.fragment:fragment-ktx 1.4.1
  • com.google.dagger:hilt-android 2.42
  • com.google.dagger:hilt-compiler 2.42
  • com.google.dagger:hilt-android-gradle-plugin 2.42
  • com.google.dagger:hilt-android-testing 2.42
  • junit:junit 4.13.2
  • org.jetbrains.kotlin:kotlin-gradle-plugin 1.6.10
  • com.squareup.logcat:logcat 0.1
  • com.google.android.material:material 1.4.0
  • androidx.navigation:navigation-fragment-ktx 2.4.2
  • androidx.navigation:navigation-ui-ktx 2.4.2
  • androidx.preference:preference-ktx 1.2.0
  • androidx.room:room-compiler 2.4.2
  • androidx.room:room-ktx 2.4.2
  • androidx.room:room-runtime 2.4.2
  • androidx.lifecycle:lifecycle-viewmodel-compose 2.4.1
  • androidx.lifecycle:lifecycle-viewmodel-ktx 2.4.1
  • androidx.work:work-runtime-ktx 2.7.1
  • androidx.work:work-testing 2.7.1
  • org.jlleitschuh.gradle.ktlint 10.3.0
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 7.4.2

  • Check this box to trigger a request for Renovate to run again on this repository

Migrate Database to Room

The app is currently using SQLiteOpenHelper, which works fine, however we can't do things like observing the database to be automatically notified about changes.

That is why we want to migrate to Room

Update logic to store steps in the db

The current logic to store the steps count in the daily_steps db table is as follows:

day (long) steps (long)
-1 steps since boot
... that day's steps
yesterday yesterday's steps
today offset (probably negative)

That makes today's steps different than the rest of the days, and in order to obtain the real number of today's steps we need to sum the sensor steps since boot plus today's offset. This is a bit cumbersome and error prone.

The proposed new solution is:

day (long) steps (long)
-2 steps offset
-1 steps since boot
... that day's steps
yesterday yesterday's steps
today today's steps

As can be observed, today's steps are simply today's steps, no need to calculate anything else. There are a few considerations that we will have to take into account to make this work correctly. Like what to do when the device is rebooted when the user has done some steps that day already.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.