All the documentation for this project is available in the Wiki.
This project use Google Fit API to track user goals and progress. The goal of this project is to reach the Adidas code challenge.
"Sport is at the core of everything we do. In this challenge, you will be using Apple Health/Google Fit as services to get information about user's activity. Also, there is an endpoint where you can find a list of daily goals that you should retrieve and display in your app. Use aforementioned services to automatically track progress on those daily goals."
- Catch real time user steps
- List user daily goals (WALKING, RUNNING)
- Earn points by reaching goals
- Daily goals should be cumulative on the next day
Tests Coverage
- Unity tests
- Instrumentation tests
1 - Daily Goals
2 - Rewards
- Db name:
Adidas-db
- Domain Model
GoalsEntity(
@PrimaryKey var id: String = "",
var title: String = "",
var description: String = "",
var type: String = "",
var goal: Int = 0,
var progress: Int = 0,
var date: Date? = null,
var reward: RewardEntity,
var state: Int = 0
))
RewardEntity(
var trophy: String = "",
var points: Int = 0
)
id | value | color |
---|---|---|
primary | #000000 | black |
primaryLightColor | #2c2c2c | semi-black |
primaryDarkColor | #000000 | black |
primaryTextColor | #ffffff | white |
secondaryTextColor | #000000 | white |
ripple | #d1d1d1 | gray |
RUNNING | #3aaf55 | green |
FINISHED | #919191 | light-gray |
RUNNING | #000000 | bllack |
SDK Configuration
Android SDK min version 24
// GOOGLE FIT
implementation 'com.google.android.gms:play-services-fitness:16.0.1'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
//NETWORKING
implementation 'com.google.code.gson:gson:2.8.5'
//Retrofit will parse our requests easily with the endpoint
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
//GSON converter for retrofit
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
//Make async requests and provide easy ways to intercept a request
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1'
implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2'
IMAGE CACHING / RECYCLE
implementation 'com.squareup.picasso:picasso:2.71828'
IMAGE CIRCLE TRANSFORMATIONS
implementation 'jp.wasabeef:picasso-transformations:2.2.1'
Base URL: https://thebigachallenge.appspot.com
Endpoint:
Method [GET]
1 - List Goals : `_ah/api/myApi/v1/goals`
- App isn't working
If you are trying to run the app and you didn't received app feedback you probably don't have an Oauth2 client ID configured. To do this, you should register a new OAuth2 client by following these simple steps:
Request an OAuth 2.0 client ID in the Google API Console
- SDK not found when open the project
Check your local.properties
file and set the correct dir folder for your Android SDK.
- I need assistance with the project installation
Any questions, please contact: diogojme@gmail.com