Comprehensive Guide to Building Modern Android Apps in 2023
This article provides a detailed overview of the latest 2023 trends, tools, libraries, architectural patterns, and best practices for developing modern Android applications, covering everything from Kotlin and Jetpack Compose to Clean Architecture, modularization, performance optimization, and Google Play features.
Disclaimer
This article reflects the author’s personal experience and professional opinion, taking into account diverse viewpoints in the Android developer community and referencing Google’s official Android guidelines.
What is Android?
Android is an open‑source operating system based on the Linux kernel, developed by Google, and used on smartphones, tablets, TVs, and wearables. According to StatCounter, Android holds about 71.96% market share worldwide.
Kotlin ❤️
Kotlin, developed by JetBrains and officially recommended by Google since May 2017, runs on the JVM and offers full Java compatibility. It is now the preferred language for Android development, providing modern features such as Coroutines and a rich ecosystem of Android‑specific libraries.
Jetpack Compose 😍
Jetpack Compose is Google’s modern, declarative UI toolkit for Android. It simplifies UI development, integrates with other Jetpack libraries (LiveData, ViewModel), and offers features like declarative UI, customizable widgets, easy code integration, real‑time preview, and performance improvements.
Jetpack Compose documentation
Android Jetpack
Jetpack is a suite of libraries that help developers follow best practices, reduce boilerplate, and write code that runs consistently across Android versions and devices.
ViewModel
Room
DataStore
WorkManager
Navigation
CameraX
Compose
Material Design
Material Design is a system of guidelines, components, and tools that promotes UI best practices, facilitates collaboration between designers and developers, and helps teams quickly create attractive products across Android, Flutter, and Web.
Clean Architecture
Clean Architecture, introduced by Robert C. Martin, separates software into layers to isolate responsibilities. Its key characteristics are framework independence, testability, UI independence, database independence, and external‑agent independence. The dependency rule states that source code may only depend inward, never outward.
In Android, Clean Architecture typically consists of:
Presentation layer: Activities, Fragments, ViewModels, UI components
Domain layer: Use‑cases, entities, repositories
Data layer: Repository implementations, mappers, DTOs
Presentation Layer Architecture Patterns
Common patterns for the presentation layer include MVVM and MVI, which address reusable solutions for UI structure and data flow.
Dependency Injection
Hilt ❤️
Dagger
Koin
Modularization
Modularization splits an app into independent modules, each with its own responsibilities, enabling reuse, strict visibility control, conditional delivery via Play Feature Delivery, scalability, easier maintenance, testing, improved architecture, better collaboration, and faster builds.
Networking
OkHttp
Retrofit
Serialization
Important serialization libraries include Moshi (JSON‑focused) and Kotlin Serialization (supports multiple formats). Both simplify converting objects to/from JSON and other formats.
Image Loading
Android official documentation
Coil
Glide
Reactivity / Thread Management
Kotlin Coroutines (suspend functions, Flow) are the primary choice for asynchronous work, while RxJava remains a powerful alternative for complex data‑stream handling.
Kotlin Coroutines (suspend/Flow)
RxJava
Local Storage
Local persistence options include SharedPreferences, DataStore, and EncryptedSharedPreferences for storing key‑value data, as well as databases for structured data.
Testing
JUnit 5
Mockk
Espresso
Robolectric
R8 Optimization
R8 is the default compiler that shrinks, obfuscates, and optimizes bytecode, converting Java bytecode to DEX format for Android.
Code shrinking
Resource shrinking
Obfuscation
Optimization
Play Feature Delivery
Google Play’s dynamic delivery uses Android App Bundles to generate optimized APKs per device, ensuring users download only the code and resources they need.
Adaptive Layout
Android provides the WindowSize class (Compat, Medium, Expanded) and classic layout resources to help apps adapt to various screen sizes and form factors.
Performance
Tools for monitoring and improving performance include Benchmark, Baseline Profiles, App Startup, Firebase Performance Monitoring, and the JankStats library.
In‑App Updates
In‑app updates, supported on Android 5.0+ devices, allow developers to prompt users to install the latest version without leaving the app.
In‑App Reviews
The Play In‑App Review API lets users submit ratings and comments without exiting the app, following strict design guidelines to protect privacy.
Accessibility
Accessibility considerations include improving text visibility, using large simple controls, and providing content descriptions for UI elements.
Security
Key security practices include encrypting sensitive data with EncryptedSharedPreferences/EncryptedFile, using signature‑based permissions, and avoiding hard‑coded secrets in source code.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp">
<permission android:name="my_custom_permission_name"
android:protectionLevel="signature" />
</manifest>Version Catalog
Gradle’s version catalog centralizes dependency versions, providing type‑safe accessors, shared version declarations, and easier management across multi‑module projects.
Logger
Logging libraries such as Timber help record runtime information, errors, and diagnostics to files, consoles, databases, or remote servers.
Linter
Linter tools analyze source code for potential issues, style violations, missing documentation, or security problems. Android Lint, Detekt, and Ktlint are common choices for Android projects.
Rare Earth Juejin Tech Community
Juejin, a tech community that helps developers grow.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.