Example that shows a possible way of structuring the code in an Android app by making use of Kotlin coroutines.
This is based on the stable version of coroutines.
The example is provided with both MVP and MVVM architectures (making use of Clean Architecture as well).
For more information on the ideas used in this source code, check the Kotlin Coroutines in Android series:
- Part 1: Introduction
- Part 2: The basics
- Part 3: Coroutines in Android Studio
- Part 4: Running coroutines sequentially or in parallel
- Part 5: Coroutine cancellation
- Part 6: Exception propagation
- Part 7: A small DSL for Android apps development
- Part 8: MVP and MVVM with Clean Architecture
- Part 9: Combining multiple tasks with the operators on collections
- Part 10: Handling callbacks
- Part 11: Channels
- Part 12: Testing
Copyright 2019 Andrea Bresolin Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.