j4velin / Pedometer

Lightweight pedometer app for Android using the hardware step sensor
https://play.google.com/store/apps/details?id=de.j4velin.pedometer
Apache License 2.0
1.44k stars 672 forks source link

Restart counter at midnight #87

Closed Odaym closed 8 years ago

Odaym commented 8 years ago

Great work on the library, I've tried 3 other apps that attempt this and they are not nearly as accurate when counting, this is really good and almost shake-proof too!

I am not sure where I'm supposed to run the code that will reset the counter to zero when I choose, it gets reset to zero on reboot but I want to reset to zero at midnight and save to shared preferences whatever value I last ended up with, any idea? Thanks again

j4velin commented 8 years ago

Isn't that exactly what the app already does?

Odaym commented 8 years ago

why would it do that? there's nothing in the code that mentions that. The only recurrent behavior that Step Counter Sensor is known for is resetting the values at phone reboot, which is why you have the Shutdown and Boot and Power receivers, to do things when that event happens, right?

http://stackoverflow.com/questions/22649324/step-counter-doesnt-reset-the-step-count

The solution given within the answer above will work I think

j4velin commented 8 years ago

Sorry, I'm not sure I understand your question. The app shows how many steps you have taken each day. A new day starts at midnight so the app shows "0 steps" after midnight until you do your next steps. The relevant code for this is in the database class

Oday Maleh notifications@github.com schrieb am Mi., 10. Aug. 2016, 23:02:

why would it do that? there's nothing in the code that mentions that. The only recurrent behavior that Step Counter Sensor is known for is resetting the values at phone reboot, which is why you have the Shutdown and Boot and Power receivers, to do things when that event happens, right?

http://stackoverflow.com/questions/22649324/step-counter-doesnt-reset-the-step-count http://url

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/j4velin/Pedometer/issues/87#issuecomment-239003268, or mute the thread https://github.com/notifications/unsubscribe-auth/ADwmyxV6oxeYDDzdcIxTKFHs9frGj_n2ks5qejxPgaJpZM4Jg7Tx .

Odaym commented 8 years ago

right, my bad! :D