Android’s <activity-alias>
tag is one of the most unused tags in the android manifest. The existence and benefits of it are unknown to many Android developers, even today.
Activity alias represents a symlink to an Activity. The most popular use of activity alias is to prevent the removal of the app launcher shortcut when the underlying launcher activity is changed.
💡 Activity alias has been residing inside the androiManifest.xml since API 1.
When a launcher icon shortcut is created, it is statically linked to the exact activity of the Launcher. …
Kotlin coding conventions denotes that we should prefer if
for binary and when
for three or more options.
when
preferred for three or more options?when
is preferred.Fuel is not an alternative for Retrofit because both the libraries offer a different experience for developers. Retrofit is currently the market standard so let us look into Fuel.
httpUrlConnection
(No Okhttp support; yet)I had a quick look at the release tags in Github and the first tag 0.6 was dated 11 Aug 2015. Its been around for quite some time now. …
Kotlin Interface supports default implementation. Which implies that we can have a default implementation to all the properties and functions defined in the Interface.
The debate:
Having default implementation on interface is not appreciated by many developers. We are not going to discuss about the pros and cons, but we are more interested in how Kotlin has achieved this.
Note: To keep things simple, the java code blocks used in this article is the decompiled java equivalent of the generated byte-code by the Kotlin compiler.
Lets take a basic interface Wheels
with default implementations as an example to understand the…
As the name states, a data class
is a class that holds data. The difference from the normal class is the auto-generation of some standard functionality and utility functions derived from the data itself.
Have you asked anyone this question ? “What’s the difference between a normal class and a data class ?”….
Usually their reply would be:
hashcode()
, equals()
and toString()
methodsLittle do they understand that there are few more functionalities generated along with the usually known functions.
The copy() function is…
Cold folding is a good practise while working on complex code. It helps us to be focus on the task ahead and not get distracted by unnecessary information. It also helps in organising code or hiding less useful information so one can focus on more important information.
In this blog we will focus on Regions, a small topic in code folding.
The syntax to create a custom regions starts with a comment followed by the keywordregion
and end block with the comment endregion
. This can be very helpful in grouping of code and also for documentation.
//region $NameOrDescriptionOfRegion
someCodeHere()
//endregion
…
The ability to work on multiple projects with different team members have always been the strong suite of people at Modulotech. Over the years we have been successful in sharing our knowledge with everyone and every project, as we have multiple contributors working towards the same goal. The journey towards this goal is not yet achieved, as the journey never ends.
Here, I would explain a small change in our big journey, our transformation from an unformatted git message to a better solution.
Every change is treated as a magic trick. We are the magicians and the audience.
Every magic…
It is one thing to come up with intuitive naming for String keys but its totally another to manage and organise your colors in an Android project.
The Problem :
Your colors.xml will initially have the primary, primaryDark and accent by default, based on your theme pallette.
Later you would add few colors with their proper name.
ex: white, black, red etc,.
But before you could realise, you would have started adding the location of the color, as the key, rather than the color itself.
ex: login_bg_color
Never .gitignore a .gitignore
It’s a good practise to follow a common .gitignore for all your Android projects.
# Built application files
*.apk
*.aar
*.ap_
*.aab# Files for the ART/Dalvik VM
*.dex# Java class files
*.class# Generated files
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/# Gradle files
.gradle/
build/# Local configuration file (sdk path, etc)
local.properties# Proguard folder generated by Eclipse
proguard/# Log Files
*.log# Android Studio Navigation editor temp files
.navigation/#…
Tech Lead Android, Modulotech