TrackMyPath
TrackMyPath copied to clipboard
An Android app written in Kotlin that demonstrates a clean architecture with MVVM, Fused Location Provider, LifecycleService, and Coroutines. It is used as lab to test new Android features.
Track my path
An android app that tracks your walk with images every 100 meters:
- images fetched from Flickr based on location
- pictures are shown in a list, and user can scroll through the stream
- one button start/stop, on each start the previous stream of photos gets wiped
- when the app is removed from background and user has not stopped the tracking, the tracking continues in a service
Please create a Flickr account and use your own api key. Add it in the FlickrApi file.
MVVM pattern with Clean architecture developed with Kotlin.
Clean architecture consists of three layers:
- Data, includes data objects, databases, network clients, repositories.
- Domain, includes use cases of business logic. This layer orchestrates the flow of data from Data Layer to Presentation and the other way.
- Presentation, includes UI related components, such as ViewModels, Fragments, Activities.
Android Jetpack Components used:
- Fragment
- ViewModel
- LifecycleService
- View Binding
- LiveData
- Room
- Location
- ActivityScenario, instrumentation testing (part of AndroidX Test)
- Espresso (UI tests)
Libraries:
- Koin, (in master branch) an easy-to-use DI framework. Nice comparison with Dagger
- Hilt (in feature-hilt-di branch) a DI library for Android based on Dagger
- Kotlin Coroutines
- fresco, an Android library for managing images and the memory they use
- Retrofit
- OkHttp
- moshi, JSON library for Kotlin and Java
- Timber, a logger which provides utility on top of Android’s Log class
- detekt, Static code analysis for Kotlin
Flickr API:
Sources:
- Google I/O 2018 app — Architecture and Testing
- Clean Architecture of Android Apps with Practical Examples
- Clean Architecture Guide (with tested examples): Data Flow != Dependency Rule
Screenshots