Hello everyone! 👋 In this story I will explain a simplified approach to dynamic features with Dependency-less Navigation & Koin. I will start by covering what dynamic features are & what changes are involved with the common project setup.
Dynamic Delivery is Google Play’s new way to distribute apps. It uses Android App Bundles (.aab) which is a way to defer APK generation and signing to Google Play on install. This allows the optimization of the APK built for your specific phone (removing unnecessary resources & hardware architectures).
Dynamic Feature Modules also take advantage of Dynamic Delivery, allowing dynamic app features to be installed & removed at a later stage using PlayCore API. …
Hello everyone! 👋 In this story I will show how to improve your Kotlin codebase with Detekt, a Kotlin Static Analysis Tool.
Detekt will analyze Kotlin code with multiple rule sets and flag the code that breaks any of its rules. Detekt improves the codebase by enforcing rule sets including complexity, naming, performance & potential-bugs among others.
When added to CI (in my case, CircleCI) it will also act as a safety net in case you try to merge code which contains Kotlin code smells.
Before starting: Make sure you have the latest Gradle (4.10.2 right now) in the gradle-wrapper.properties …
Hello everyone! 👋 In this story I want to explain how I used Koin, a Dependency Injection framework, in my Multi-Module Feature Project.
A pragmatic lightweight DSL dependency injection framework for Kotlin.
Koin is easy, simple & well documented. It is perfect for encapsulated feature/library modules.
If you are not familiar with feature modularization you can check my Intro to App Modularization (modules based on features, not the standard monolithic modularization with presentation, domain & data modules). …
Ktlint will remove the work that involves following the Kotlin Style Guide.
When added to CI (in my case, CircleCI) it will also act as a safety net in case you try to merge code that isn’t following the Kotlin Style Guide.
Ktlint provides a built-in formatter task called
ktlintFormat and it can also update your Android Studio formatting.
Using Ktlint will also save discussion time. From Ktlint’s GitHub.
No configuration. Which means no decisions to make, nothing to argue about and no special files to manage. …
Hello everyone! 👋 In this story I want to give a brief introduction to App Modularization, some thoughts around it & first steps you can take to achieve it.
App Modularization is the process of applying Modular Programming to our Android App.
Modular programming is a software design technique to separate functionality into independent, interchangeable modules, so that each contains everything necessary to execute a specific functionality.
We can achieve this through the creation of Feature Modules.
Hello everyone! 👋 In this story I want to explain Clean Architecture (with tested examples) & talk about the most common mistake when adopting it (the difference between Data Flow and Dependency Rule).
This story is the follow up after my latest medium Intro to App Architecture. Make sure to check it out if you are interested in what makes a good Architecture & why + how to achieve a more maintainable codebase.
Let’s start explaining Data Flow in Clean Architecture with an example.
Imagine opening an app that loads a list of posts which contains additional user information. …
Hello everyone! 👋 Today I want to talk about the importance of architecting our apps and the main concerns around it. 🤔
This is the main benefit of architecting our apps and libraries. A maintainable project means that its codebase is easy to (RUDT) Read, Update, Debug & Test. ☮️
Fighting Technical Debt
Technical Debt is the price that our projects pay for the wrong decisions. This can affect 1 or multiple RUDT points. Resulting in a more complex and/or error-prone codebase. 👊
Read: Read from an objective point of view. Don’t let your familiarness blur how readable something really is. …
Hello everyone! 👋 This story is aimed at anyone interested in Continuous Integration (CI). I will focus on how to implement CircleCI in any Android project.
Let’s begin with one important question. Why would we want to have CI in our projects?
Increase the speed of development while ensuring the quality of the code.
It also helps to avoid this kind of situation:
Hello everyone! 👋 In this story I want to share some light on how you can use ViewModel (Android Architecture Components) with Dagger 2 Injection.
If you aren’t familiar with ViewModel and LiveData I highly recommend my previous story: https://proandroiddev.com/the-death-of-presenters-and-the-rise-of-viewmodels-aac-f14d54b419a
Adding @Inject to our ViewModels won’t work out of the box 😢. So how can we make our ViewModel figure out the dependencies?
The above & adding this ViewModelModule to our Injector class is everything we need to do.
Remember to add any new ViewModels to your ViewModelModule.
ViewModelProviders.of() method as the factory (second parameter).
Done! Our ViewModels with @Inject will now work. 💃
For @Inject with dynamic parameters read an interesting issue over here.
You can always check my sample project down here 👇
Hello everyone! 👋 In this story I will quickly go over ViewModel and LiveData from Android Architecture Components (AAC) and will present you with some perks you should consider.
ViewModel survives rotation & other configuration changes.
ViewModel keeps running while the activity is on the back stack.
ViewModel is Lifecycle agnostic. You can
override onCleared(to clear disposables for example) just before the ViewModel is about to get killed.
ViewModel promotes simple and concise code.
ViewModel promotes reactiveness based on state down to the view by letting the view observe the live data inside the view model. …