Professional Android App Foundation

Kevin Alexander Soto
5 min readAug 31, 2023

--

This post gives you a list of things to do when you create a new Android app. This list is based on my experience as an Android developer. If you think that a professional app requires any additional features at the beginning, feel free to share your opinion in the comments.

Centralize the dependencies

Centralizing the dependencies means using a version catalog or another way to separate and share the dependencies of the app. By doing this, in the future, you don’t have to worry about updating version dependency by dependency or changing the version module by module.

Add the more common dependencies and the possible future ones

When creating a new Android app, there are some dependencies that are essential for the project, such as compose, a DI library, Retrofit (or another HTTP client), Room, an image loader, Coroutines, Material 3 or navigation. Additionally, it might be convenient to add project-specific dependencies, such as CameraX, FireBase, Epoxy, or other particular needs of the app. This will make the team’s work easier in the future.

Add Build variants

Define the debug, release, QA-specific variants, and if it’s possible the specific environments(like the backEnd endpoint).

Set an output name for the APK or bundle app

At the beginning of the development process may not be useful and if your team has a CI/CD process this will not have a big impact, but if you are in a small company could be probable that you have to send the APK to the QA or to some one else to see a demo of the application. Setting up the name for the output APK will help you and the team to identify the version and buildVariant of the App.

Configure Network security file

This can help you customize and protect your app’s network communications. Some of the reasons to use this file are:

  • Customize the Certificate Authorities (CA) that you trust for your app’s secure connections. For example, trust self-signed certificates or restrict the set of public CAs that you trust.
  • Override security settings only for debugging, without affecting your app’s installed base.
  • Opt out of cleartext (unencrypted) traffic, to protect your app from accidental usage of this type of traffic.
  • Pin certificates, to restrict your app’s secure connection to specific certificates.

Here you can find more information and details on how to use this file.

Set up the DI

Libraries like Dagger Hilt require setting up the Application and adding other plugins, be sure that this is done.

Accelerate the build process

It is important to accelerate the build process in Android because this can improve the productivity and efficiency of the developers. A fast build process allows you to test and debug your code more easily, as well as implement changes and new features more frequently. Additionally, a fast build process reduces the waiting time and frustration of the developers and in some cases, the CI/CD pipeline build time for new artifacts which improves their experience and satisfaction. Here you can find more information about the configuration, the usual modification is to increase the JVM heap size and experiment with the JVM parallel garbage collector.

Plan the app for modularization

It is important to have a plan for the app modularization in Android because this can improve the maintainability and overall quality of the code. Modularization is a practice of organizing the code into independent and clear-purpose parts, called modules. Some of the benefits of modularization are1:

  • Reusability: Modularization enables code sharing and building multiple apps from the same foundation. Modules are building blocks. Apps should be a sum of their features, where the features are organized as separate modules.
  • Strict visibility control: Modules enable you to easily control what you expose to other parts of the code. You can mark everything but your public interface as internal or private to prevent it from being used outside the module.
  • Customizable delivery: Play Feature Delivery uses the advanced capabilities of app bundles, allowing you to deliver certain features of the app conditionally or on demand.
  • Scalability: In a tightly coupled codebase, a single change can trigger a cascade of alterations in seemingly unrelated parts of code. A properly modularized project will embrace the separation of concerns principle and therefore limit the coupling. This empowers the contributors through greater autonomy.
  • Ownership: In addition to enabling autonomy, modules can also be used to enforce accountability.

To see modularization in action, you can check out the Now in Android project2. It’s a fully functional app that has a multi-module codebase, and there’s a handy learning journey on modularization that outlines what the modules do and how they communicate with each other.

I appreciate your time and attention to this article! If you enjoyed it, please show your support by clapping. I would love to hear from you on Linkedin and Twitter. You can also follow me and this publication for more interesting content. Thank you!

--

--

No responses yet