An Android app that notifies you when you start walking by sending you a notification and playing a sound.
I made this app because I always forget to turn on the Charity Miles app when I go for a walk. And also I wanted to try the play-services-fitness API. The minimum Android version required is API level 21 5.0 (LOLLIPOP)
- Fitness History API to query for step_count.delta in the checked period of time
- ReactiveX/RxAndroid to describe my interval based logic in more readable way
- Service which is defined as indestructible and handles the detection
- Alarm manager to send auto start and stop Intents to the Service
- Lambda expressions
- Butterknife field and method binding for Android views
- Adaptive icons just to test them
- AnimatedVectorDrawable to animate the FAB icon on the Home screen
- Get an OAuth 2.0 Client ID this is needed for developer authentication for the Fit App. The link describes how to generate it. Once generated it is not used anywhere. The servers know that the build is made on your machine because of the Certificate fingerprints you give them through the generation process.
- Open the project in Android Studio
- You will need Java 8. Update the Android plugin to 3.0.0-alpha1 (or higher) or add Retrolambda to the gradle.
- In your gradle.properties file you need to add:
RELEASE_STORE_FILE=<path_to_your_jks>
RELEASE_STORE_PASSWORD=<password>
RELEASE_KEY_ALIAS=<key_alias>
RELEASE_KEY_PASSWORD=<password>
- In order for the certificate to work you may need to Build signed APK from Build > Generate Signed APK > Create new / Choose existing
Please feel free to contact me if you have any questions. :)