<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Khoi Nguyen on Medium]]></title>
        <description><![CDATA[Stories by Khoi Nguyen on Medium]]></description>
        <link>https://medium.com/@khigianguyen?source=rss-989ef244f50a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*HrR99TU0YWhfqOEscFkM-w.jpeg</url>
            <title>Stories by Khoi Nguyen on Medium</title>
            <link>https://medium.com/@khigianguyen?source=rss-989ef244f50a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 19:28:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@khigianguyen/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Modularization in Android App: Building Flexible and Scalable Apps]]></title>
            <link>https://medium.com/@khigianguyen/embracing-modularization-in-android-app-architecture-building-flexible-and-scalable-apps-f5f0696bbf85?source=rss-989ef244f50a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5f0696bbf85</guid>
            <category><![CDATA[multi-module-project]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kmm]]></category>
            <category><![CDATA[clean-architecture]]></category>
            <category><![CDATA[modularization]]></category>
            <dc:creator><![CDATA[Khoi Nguyen]]></dc:creator>
            <pubDate>Tue, 04 Apr 2023 16:33:15 GMT</pubDate>
            <atom:updated>2023-04-08T08:59:59.386Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Introduction</strong></h3><p>In today’s rapidly evolving mobile app landscape, developers are constantly seeking ways to build apps that are not only efficient but also highly scalable and maintainable. One such approach gaining traction in the Android ecosystem is modularization — breaking down a project into smaller, more manageable modules. This article will explore the benefits and practicalities of modularizing Android projects vertically (module per feature) and horizontally (module per data layer).</p><p>By embracing a multi-module architecture, developers can create apps with enhanced flexibility and improved code reusability. Moreover, this modular structure paves the way for seamless integration with KMM, making cross-platform app development more accessible.</p><h3>Module descriptions</h3><p>In this article, I use a run tracker app as an example to demonstrate modularization, making it easier for you to follow and apply these concepts to your Android projects.</p><p>(For real use cases and further references after this blog post, you can refer to this project which applies this modularization method: <a href="https://github.com/khoi-nguyen-2359/myrun">https://github.com/khoi-nguyen-2359/myrun</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/0*KvTvHYBHWmqW7G4G" /></figure><ol><li><strong>:app Module</strong></li></ol><ul><li>Type: Android application module</li><li>The <strong>:app</strong> module serves as the main entry point for the app. It contains the primary app components, such as the Splash and Home screens, which initialize and display the app’s entrance interface.</li></ul><p><strong>2. :feature:[feature_name] Modules</strong></p><ul><li>Type: Android library modules</li><li>These modules represent individual screens or groups of related screens within the app. Each <strong>:feature:[feature_name]</strong> module focuses on a specific functionality and is responsible for the presentation layer of that feature. Dependencies for these modules include Android-specific components like Activities, Fragments, and Composable UIs.</li></ul><p>Examples of <strong>:feature:[feature_name]</strong> modules:</p><ul><li><strong>:features:profile </strong>— View/Edit user profile screen</li><li><strong>:feature:registration</strong> — Login screen</li><li><strong>:feature:activity</strong> — Feed, Activity details, Stats screens</li><li><strong>:feature:core</strong> — Core features like navigation, common UI components, and UI utilities. This is the base feature module all other feature modules depend on.</li></ul><p><strong>3. :data:api Module</strong></p><ul><li>Type: Android library modules</li><li>This module houses the contracts of all data modules, including Repository, DataSource interfaces, and Model classes. The <strong>:data:api</strong> module defines the structure and relationships between these components.</li><li>Dependencies: Kotlin only</li></ul><p><strong>4. :domain Module</strong></p><ul><li>Type: Android library modules</li><li>The <strong>:domain</strong> module contains the app’s business logic, including use cases. This module utilizes interfaces in the <strong>:data:api</strong> module and remains agnostic to their concrete implementation.</li><li>Dependencies: Kotlin only</li></ul><p>(Note: Consider <strong>:domain</strong> and <strong>:data:api</strong> as modules to be shared in a KMM project)</p><p><strong>5. :data:[data_name]</strong> Modules</p><ul><li>Type: Android library modules</li><li>These modules provide concrete implementations for the contracts defined in the <strong>:data:api</strong> module. They are responsible for handling data retrieval and storage and choosing the appropriate libraries for these tasks.</li><li>Dependencies: Retrofit, Firebase, Room, Preferences, File, Google Map, MapBox</li></ul><p>Examples of <strong>:data:[data_name] </strong>modules:</p><ul><li><strong>:data:user </strong>— User profile data, logging in state</li><li><strong>:data:activity </strong>— User running or cycling activities in history</li><li><strong>:data:tracking</strong> — Recorded locations while the user is running</li></ul><p>An example of component relationship between modules:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1uYZqvTE_LnNjK_fzBp5Pw.png" /></figure><h3>Conclusion</h3><p>By dividing projects into focused modules, developers can streamline their work process and simplify testing and maintenance. Moreover, this approach facilitates a smoother migration to Kotlin Multiplatform Mobile, broadening the horizons of cross-platform app development. By familiarizing yourself with the different module types and their functions, you can begin to harness the power of modularization in your Android projects.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5f0696bbf85" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>