One upon a time, there was a singularity named :app module. Then came the smaller monoliths, namely :persistence, :networking and :models
:app
:app
still applies to :networking
, :persistence
and :models
while you get none of the benefits modularization brings:app
module by layersEven though Proguard and R8 removed the unused code for you at release time, you should still make effort to remove dead code to reduce confusion, increase productivity of your everyday work and onboarding.
For starter, none of the static code analysis tools (SonarQube, CheckStyle, Pmd, Findbugs, Android Lint) I know does the job.
Since Proguard and R8 removed unused classes, I followed the instructions here and generated and generated an usage.txt file
-printusage
to your proguard.pro file./gradlew app:minifyReleaseWithProguard
or ./gradlew app:minifyReleaseWithR8
But the usage.txt file is big and I can clearly see some classed that are used, not dead code. …
Imagine you went to meet your Tinder date and were informed on the spot that John or Mary or both were gonna join you presently. Replace Tinder date with your credit card application and and voila! Equifax and TransUnion are gonna enter your life and never leaves, forever ruining your relationships in a creepy way
My first bank account in Canada was frozen out of the blue in June 2020. For more than 3 months, I had never been offered anything more than “one of the credit bureaus put a restriction on your files”.
My credit started at below 650 which means Poor credit. Which means none of the following means…
Given a list of Employees, find the average and sum of salary for each department.
You don’t have to be a Kotlin-programmer or any programmer to complete the following 4 tasks, just a curious mind and a love for numbers will do
Each Employee has the following properties:
Does that sound familiar? I’m sure it does to all of us who have been through the 101 tutorial for Excel and SQL.
Buckled up as today we are going to learn how to achieve the same tasks with Kotlin aka. …
Recently, when doing a small coding challenge in Kotlin I was faced with the choice of mutableMapOf()
or HashMap()
Being a Java old-timer, I went with HashMap()
.
But but… all the Kotlin tutorials start with mapOf()
and mutableMapOf()
?
Afterwards, I had some interesting discovery to share here:
Behind the scene, both mapOf
and mutableMapOf
use Java’s LinkedHashMap data structure
Utimately, the comparison between
mapOf
,mutableMapOf()
andHashMap()
is down to LinkedHashMap vs. HashMap in Java.
These are the 2 most popular implementations of Map (or Dictionary or Hashtable if you will) data structure in Java. …
There’s no one-size-fit-all solution here but Tangerine is a good start
The time and money you spend on your trips to the bank branch can be spent on something else valuable.
Remember those times you went there only to realize the branch is closed or you left an important document at home?
No more!
Remarkedly, I moved to Canada just before the Covid-19 pandemic causing all brick and mortar banks to close. Tangerine (and Canada Post of couse) saved me this time!
As online-only banks saves a lot of costs from operating physical branches, they can invest more in innovations, thus improve their service quality. …
After struggling to set up Dagger from scratch N times, this article will make the (N+1)th time much easier, hopefully.
As explained by Dan Lew, it simply means passing dependencies through your class’s constructors or functions’ parameters so as to be able to swap them in unit tests.
(MVP is used for simplicity here. Same concepts apply to MVVM)
Here’s a very basic testable Presenter that make use of dependency injection:
We’ve covered the output streams (ViewState and ActionState) in part 1
Quick recap of the output streams in part 1:
In this part, I’m omitting the ActionState Observer, as the ViewState Observer alone is sufficient to demonstrate the “good practice” I want to introduce here.
Now after initialisation, there are important events with important data that need to be processed like onActivityResult
, __Swipe to Refresh__. Only the View (Activity/ Fragment) receives them so it’s supposed to relay them to the ViewModel. …
About