AndroidMakers by droidcon 2023

Kamal Faraj
9 min readMay 4, 2023

--

Illustration from frog.co

At frog, we were thrilled to attend AndroidMakers by droidcon, a 2-day conference that brought together over 800 participants for more than 80 talks.

You can watch all the replays on YouTube, but keep reading if you want a brief summary of the talks focused on Modern Android Development.

TL;DR: Built on top of a robust architecture, now is the time to modularize your app, declare components with Jetpack Compose and dive into the world of Kotlin Multiplatform.

Android Graphics: the Path to [UI] Riches

Why Graphics APIs are so complicated?

In 2005, Google acquired Skia, an open source 2D graphics library which now serves as the graphics engine for Android. Many Android classes such as Canvas or Paint come from Skia classes such as SkCanvas or SkPaint.

At that time, most APIs were designed to avoid allocation due to limitations such as poor CPU performance and may seem confusing today. However, they still provide powerful features that are actually used under the hood by Jetpack Compose.

In recent years, Modern Android Graphics APIs have been enhanced with Kotlin concise language and Jetpack Compose declarative approach.

In the future, existing classes will continue to be improved and the new androidx.graphics libraries will go further with backward compatible APIs adding support for advanced shapes and animations.

Soriya Thach | http://Soriya.fr

En quête de perf: l’art subtil du profiling Android*

Square develops well-known open source libraries but their business model is based on software and hardware development for payment methods, such as payment terminals built on top of Android.

As such, they have large or complex code base in which investigating performance issues can be difficult. Here are some tips to make things easier.

First of all, keep it real! Reproduce real life use case and environment, and avoid testing on emulators.

Create a profileable release build rather than a debug build and start with a UX perspective then go progressively deeper into code, taking notes and hypothesis at each step about what you observe.

Once you reproduce an issue, use Perfetto rather than recording the System Trace with Android Studio because it is faster and offers a higher level point of view. Identify which traces take too much time and which threads are doing work at the same time. Then, use Android Studio to record the Callstack Sample and investigate the threads.

For other issues such as memory leak, proceed the same way and investigate with the right configuration.

Help! What is my place in the IC vs. EM career path?

Having a career path is important for both a collaborator and a company to grow.

Invidual Contributor is focused on personal tech expertise while Engineering Manager is more focused on people management. In either cases, we all have an impact on our team and our company.

It is also possible to mix both, but it can be challenging switching between tasks or dealing with interruptions, which requires good organization.

This is my case at Capgemini Invent, where I started as a Software Engineer and then evolved as a Software Engineering Manager. Hopefully, having a clear career path helps me to focus on what is important.

One piece of advice is that no matter the career path you choose, always work on your soft skills.

Forging the path from monolith to multi-module app

Modularization improves separation of concerns in a large codebase and clarifies ownership in a team. In some scenarios, it can also improve build performance.

Keep in mind that there is no perfect solution and that you should always adapt the solution to your needs.

For general guidelines, I would recommend to refer to the Guide to Android app modularization.

In addition, a feature could be user facing or not, like a screen or a media player. The app module should be lightweight and simply embed the feature modules. In a large project, you can start with a legacy module that will not receive updates and extract code from there gradually. You can also use Cookiecutter to generate templates and quickly set up modules.

90s Website … in 2023 on mobile in Compose … for science

The Memphis design influenced the style in the 80s and even websites in the 90s with lot of colors and animations.

Trying to reproduce this style today can be tricky but Jetpack Compose is powerful and lets you achieve such behavior that would have been difficult or impossible to reproduce with Views. Composables and Modifiers make it easy to customize and animate the UI.

Even better, Compose Multiplatform is based on Jetpack Compose to help you declare UIs for multiple platforms with Kotlin, such as Android, iOS, Desktop or Web.

For a complete example, check out the Groove is in the Heart sample.

Desktop | Groove is in the Heart

Going on a road trip with Android Auto

Android runs on a wide variety of devices, including cars.

Android Auto displays an optimized projection of the phone to the driver while Android Automotive OS is a standalone OS for cars. Available on more than 100 million cars, it offers new market opportunities.

Supported categories on the Google Play Store are limited to Media, Navigation, Messaging, Point Of Interest, Internet Of Things or Video. There are strict guidelines to follow due to security concerns while driving.

Hopefully, the androidx.car.app libraries provide templates optimized for cars so that adding support to an existing app is not that difficult.

Make Gradle work for you, create your own tasks and plugins

The Gradle build system uses tasks and plugins to handle the build logic of apps and libraries.

There are several approaches to write custom tasks, starting at the module level build.gradle.kts file that comes with a lack of reusability, to the buildSrc module that comes with an impact on build time due to the invalidation of the cache, and finally to the custom build-logic module that is more complex to set up but offers the best performance. Simply declare it in the includeBuild block in the root settings.gradle.kts.

Both the buildSrc and build-logic modules must be configured with their own settings.gradle.kts and build.gradle.kts before they can be used to create custom Task classes. Also make sure to declare tasks lazy to avoid running them too early.

To avoid duplicating the task registration, it is even better to create custom Plugin classes and expose them through the gradlePlugins block.

Practical ADB usage to enhance your life!

The Android Debug Bridge lets an Android device communicate with a computer.

There are so many commands available, but here is an example of how they can be used to automate input flows such as entering text or tapping on the screen to improve productivity on a daily basis. With a combination of uiautomator, grep, cut and sed you can write a bash script to locate input fields and automate a login flow instead of doing it manually many times a day. On a Mac, Automator can even run those scripts with keyboard shortcuts. It is also useful to remember that adb shell saves the file result on the device while adb exec-out saves it on the computer.

It is just a first glance of the opportunities you have to improve your productivity.

Un Design System, ça se Compose !*

One way to start adopting Compose in a project is to partially migrate components thanks to its interoperability with the Views system.

The team at Deezer decided to split their Design System with both Compose and Views to migrate the app screen by screen, ensuring a consistant look and feel within each screen. Once a component is created in the Compose system, it is deprecated in the Views system and remains available until the migration is complete.

When designing your Design System, follow Atomic Design Principles to separate responsibilities, from simple design tokens to more complex components. Also, separate the Design System library from the client app to easily iterate, visualize and test it. Material Design 3 can be used to customize colors, shapes and typography but if you want more control you can build your own Design System from the ground, choosing the right Compose layer. In any case, reduce the responsibilities of each component to improve reusability and don’t forget accessibility when designing your own components.

Soriya Thach | http://Soriya.fr

How to ship apps better, faster, stronger

When working in a team and delivering features, send smaller pull requests to avoid merge conflicts. Then, use feature flags to hide new features from the end user until they are production ready. A feature flag is more complex than a single boolean value, it should be attached to a particular version, it can be enabled from a server and it also allows A/B testing.

To make sure it is immediately evaluated, fetch the feature flags on app launch but only load the minimum required data to avoid slowing down app start up time.

Finally, ship continuously with release trains which are fixed scheduled release updates, most of the time weekly, and if you miss the train just wait for the next one. Make sure that the main branch is always stable with automation and tests. Once released, monitor your app performance and features adoption.

Exploring the Kotlin Multiplatform Ecosystem

Kotlin Multiplatform continues to evolve, just as the interest from the community. More and more libraries are available and cover different parts of app architecture.

Ktor allows networking either as a server or a client. For Android developers, Ktorfit provides Retrofit like Multiplatform APIs.

Multiplatform Settings allows to save key-value pairs like SharedPreferences on Android while KStore stores objects in files. Databases are also supported with SQLDelight based on SQLite or Realm based on MongoDB.

Dagger is not ready yet but Koin already allows dependency injection.

Globally, the integration is easy for Android but can be tricky for iOS. Kotlin Multiplatform is still in beta but should be stable and ready for production this year.

Are your secrets secure — How mobile apps are leaking millions of credentials

Digital Authentication Credentials are any secrets allowing authentication such as tokens or passwords.

Already millions of secrets are leaked by Open Source Softwares. Even private repositories are at risk because they often give internal access to many developers that can leak some data publicly, or a private repository might become public some day and expose secrets in its commit history.

Some tools allow to easily download an APK from the Google Play Store like Command Line APK Downloader and decompile it to search secrets like JADX. This is why secrets should be restricted and served on the server and never stored in the APK.

Code obfuscation isn’t enough and only makes it slightly more difficult for the attacker. Keep in mind that any secret embedded in a APK will always be accessible.

Migrate to Gradle version catalog and convention plugins

Gradle version catalog is the best practice to declare and share dependencies on an Android project. It can even be published and shared between multiple projects within a company.

Gradle convention plugins allow to share build logic between modules which is very useful in a modularized app to avoid code duplications.

It is possible to reuse the version catalog from the build logic module with the following build script:

settings.gradle.kts

One last tip, you can use refreshVersions to automatically update dependencies on your project instead of wasting your time checking manually.

Defensive Programming: The Best Software Development Methodology Ever Invented

Last but not least, Chet Haase and Romain Guy performed their traditional comedy talk. Spoiler alert: ChetGPT is the future!

Soriya Thach | http://Soriya.fr

It was great to meet other developers sharing their passion. The staff and the speakers did an amazing work again this year. Have fun developing on Android or Multiplatform and see you next year!

* Some talks have titles in French

--

--