<?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 Iyke Emmanuel on Medium]]></title>
        <description><![CDATA[Stories by Iyke Emmanuel on Medium]]></description>
        <link>https://medium.com/@emmanueldav?source=rss-b035fbc2b13c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fUlkot8npBiPuKfkd2ZnKg.jpeg</url>
            <title>Stories by Iyke Emmanuel on Medium</title>
            <link>https://medium.com/@emmanueldav?source=rss-b035fbc2b13c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 16:06:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@emmanueldav/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[androidApp vs androidMain vs iosMain vs iosApp: The New KMP Folder Structure Explained]]></title>
            <link>https://emmanueldav.medium.com/androidapp-vs-androidmain-vs-iosmain-vs-iosapp-the-new-kmp-folder-structure-explained-5027f3c39925?source=rss-b035fbc2b13c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5027f3c39925</guid>
            <category><![CDATA[jetbrains]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[compose-multiplatform]]></category>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <dc:creator><![CDATA[Iyke Emmanuel]]></dc:creator>
            <pubDate>Tue, 04 Aug 2026 14:45:20 GMT</pubDate>
            <atom:updated>2026-08-04T14:50:33.800Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8XOfCbsrMvZuOwQ-LNBvmQ.png" /></figure><p>New APG 9 Structure for KMP you must know</p><h3>Introduction: What Changed Everything</h3><p>If you’ve created a Kotlin Multiplatform project recently, you might have noticed something different. The familiar composeApp module that held <em>everything</em> is gone. In its place: a clean shared module, separate androidApp and iosApp modules, and a set of source sets (commonMain, androidMain, iosMain) that finally make sense.</p><p>This isn’t just a cosmetic change. AGP 9.0 forced this. And if you don’t understand the new structure, your builds will fail, your team will be confused, and your project will become a maintenance nightmare.</p><p>This article explains exactly what goes where and why getting it wrong can silently break something.</p><h3>The Old Way: The composeApp Monolith</h3><p>Before May 2026, most KMP projects had a single composeApp Gradle module that did <em>everything</em>:</p><pre>Old Structure (AGP 8.x):<br>├── composeApp/                    ← Everything in one module<br>│   ├── src/<br>│   │   ├── commonMain/            ← Shared Kotlin code<br>│   │   ├── androidMain/           ← Android-specific implementations<br>│   │   └── iosMain/               ← iOS-specific implementations<br>│   └── build.gradle.kts           ← Library + Android App plugins together<br>├── iosApp/                        ← iOS Xcode project<br>└── ...</pre><h3>The Problems With This Structure</h3><ol><li><strong>Mixed responsibilities</strong>: The composeApp module was both a KMP library (containing shared code) and an Android application (containing the Android entry point and UI). This made it nearly impossible to tell which configuration was setting up the library versus the app itself.</li><li><strong>Asymmetry</strong>: iOS apps were already in a separate iosApp folder because they require an Xcode project. But Android, Desktop, and Web apps were all crammed into composeApp. Different platforms, different rules = chaos.</li><li><strong>AGP 9.0 incompatibility</strong>: The Android Gradle Plugin 9.0 requires that the Android application entry point be in a separate module from the shared code. The old composeApp structure violated this requirement.</li><li><strong>Inconsistent onboarding</strong>: New developers joining the team couldn’t quickly understand where to put code. “Does this go in composeApp or iosApp? Wait, there&#39;s a shared module too?&quot;</li></ol><h3>The New Way: Clear Separation of Concerns</h3><p>JetBrains introduced a new default project structure in May 2026 that solves all of these problems. The new structure has one module, one responsibility:</p><pre>New Structure (AGP 9.0+):<br>├── shared/                        ← KMP Library Module<br>│   ├── src/<br>│   │   ├── commonMain/            ← Shared Kotlin code (pure logic)<br>│   │   ├── androidMain/           ← Android-specific implementations<br>│   │   └── iosMain/               ← iOS-specific implementations<br>│   └── build.gradle.kts           ← Uses Android-KMP library plugin<br>│<br>├── androidApp/                    ← Android Application Module<br>│   ├── src/main/java/             ← Android UI (Compose/XML), Activities<br>│   └── build.gradle.kts           ← Uses com.android.application<br>│<br>├── iosApp/                        ← iOS Application (Xcode project)<br>│   └── ...                        ← SwiftUI, UIKit, iOS resources<br>│<br>└── ...</pre><h3>The Key Insight</h3><p>The shared module is just a library. It contains no UI, no Activities, no app entry points. It&#39;s purely business logic, models, networking, and validation code that can be shared across all platforms.</p><p>The androidApp and iosApp modules are just applications. They depend on the shared library and provide the platform-specific UI and entry points.</p><h3>The Four Folders Explained</h3><p>Here’s where things get confusing for beginners. Let’s break down each folder, what it contains, and crucially, what it does NOT contain.</p><h4>1. androidApp/ (The Android Application)</h4><p>What it is: The Android application module. This is the entry point for your Android app.</p><p>What goes here:</p><ul><li>Jetpack Compose UI screens (PaymentScreen.kt, HistoryScreen.kt)</li><li>Activities and Fragments (MainActivity.kt)</li><li>Android resources (res/ folder: layouts, drawables, strings, colors, themes)</li><li>Android Manifest (AndroidManifest.xml)</li><li>Android-specific navigation (NavHost, NavController)</li><li>Platform-specific DI setup (Koin with Android Context)</li></ul><p>What does NOT go here:</p><ul><li>Business logic (validation, use cases, models) — that goes in commonMain</li><li>Platform-specific implementations of shared interfaces- that goes in androidMain</li><li>Network calls: that goes in commonMain (using Ktor) or androidMain (if platform-specific)</li></ul><p><strong>The Golden Rule</strong>: If you delete the androidApp folder, your shared module should still compile perfectly. The shared module has zero dependencies on androidApp.</p><h4>2. iosApp/ (The iOS Application)</h4><p>What it is: The iOS application. This is typically an Xcode project that builds into an iOS app.</p><p>What goes here:</p><ul><li>SwiftUI or UIKit views</li><li>iOS app delegate, scene delegate</li><li>iOS assets (images, launch screens)</li><li>Info.plist and iOS-specific configuration</li></ul><p>What does NOT go here:</p><ul><li>Shared business logic — that comes from the shared module</li><li>Kotlin code — the shared module exports a framework that Swift imports</li></ul><p>Note: The iosApp folder is the one place where you&#39;ll write Swift code. Everything else is Kotlin.</p><h4>3. shared/commonMain/ (The Shared Logic)</h4><p>What it is: The heart of your KMP project. Code in commonMain is compiled for every platform you target (Android, iOS, Desktop, Web).</p><p>What goes here:</p><ul><li>Domain models (Payment.kt, Transaction.kt, Currency.kt)</li><li>Business logic and validation (PaymentValidator.kt)</li><li>Use cases/interactors (SendPaymentUseCase.kt)</li><li>Repository interfaces (PaymentRepository.kt)</li><li>Shared ViewModels (PaymentViewModel.kt) with StateFlow</li><li>expect declarations for platform-specific dependencies</li><li>Pure Kotlin utilities (date formatting, string manipulation)</li></ul><p>What does NOT go here:</p><ul><li>Android SDK imports (androidx.*, com.google.firebase.*)</li><li>iOS SDK imports (platform.Foundation, UIKit)</li><li>Platform-specific UI code (Compose, SwiftUI)</li><li>Platform-specific storage (SharedPreferences, UserDefaults)</li></ul><p><strong>The Golden Rule</strong>: If you import anything that starts with android. or platform., you&#39;re probably in the wrong place. commonMain should be 100% pure Kotlin.</p><h4>4. shared/androidMain/ (Android Platform Wiring)</h4><p>What it is: Platform-specific implementations for Android only. Code here is compiled only when building for Android.</p><p>What goes here:</p><ul><li>actual implementations of expect declarations from commonMain</li><li>Firebase Firestore using Android SDK (com.google.firebase.firestore)</li><li>Android SharedPreferences</li><li>Ktor HTTP engine (CIO or OkHttp)</li><li>Android-specific number formatting (NumberFormat)</li><li>Android Context and application-wide utilities</li><li>Platform-specific file system access</li></ul><p>What does NOT go here:</p><ul><li>UI code (Compose screens, Activities) — that goes in androidApp</li><li>Code that should work on iOS — that goes in commonMain (with expect)</li><li>iOS SDK imports — that goes in iosMain</li></ul><p><strong>The Golden Rule</strong>: androidMain is the &quot;wiring&quot; that connects the shared logic to Android APIs. It implements what commonMain promises.</p><h4>5. shared/iosMain/ (iOS Platform Wiring)</h4><p>What it is: Platform-specific implementations for iOS only. Code here is compiled only when building for iOS.</p><p>What goes here:</p><ul><li>actual implementations of expect declarations from commonMain</li><li>Firebase Firestore using iOS SDK (platform.FirebaseFirestore)</li><li>iOS UserDefaults (NSUserDefaults)</li><li>Ktor HTTP engine (Darwin)</li><li>iOS-specific number formatting (NSNumberFormatter)</li><li>iOS Keychain access</li><li>Platform-specific date handling (NSDate)</li></ul><p>What does NOT go here:</p><ul><li>Android SDK imports; that goes in androidMain</li><li>Code that should work on Android; that goes in commonMain (with expect)</li><li>Swift code; the shared module is Kotlin, not Swift</li></ul><p>The Golden Rule: iosMain is the iOS-side wiring that connects shared logic to Apple&#39;s frameworks.</p><h3>The Relationship: A Visual Guide</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qdLCPtQ6_srG29zRnPDTxg.png" /></figure><h3>The AGP 9.0 Forced Migration</h3><p>This new structure isn’t optional. AGP 9.0 makes it mandatory.</p><h4><strong>What Changed in AGP 9.0</strong></h4><ol><li>Kotlin is now built into AGP: You no longer need to apply the org.jetbrains.kotlin.android plugin separately for Android apps.</li><li>New Android-KMP library plugin: AGP 9.0 introducescom.android.kotlin.multiplatform.library, built specifically for multiplatform projects.</li><li>Incompatibility with old plugins: The old combination of org.jetbrains.kotlin.multiplatform + com.android.application (or com.android.library) in the same module no longer works with AGP 9.0.</li></ol><h4>The Migration Steps</h4><p>If you’re migrating from the old composeApp structure:</p><ol><li>Extract the Android app entry point into a separate androidApp module.</li><li>Create the androidApp directory at the root of your project with an empty build.gradle.kts and src directory.</li><li>Add the module to settings.gradle.kts: include(&quot;:androidApp&quot;).</li><li>Migrate the shared module to use the new Android-KMP library plugin.</li><li>Remove the Kotlin Android plugin from your Android app module (it’s now built in).</li><li>Sync and test.</li></ol><h3>Temporary Workaround (Don’t Rely on It)</h3><p>You can temporarily enable legacy APIs by adding android.enableLegacyVariantApi=true to gradle.properties. But these legacy APIs will be removed completely in AGP 10.0.</p><p>Don’t wait. Migrate now.</p><h3>The Golden Rules of KMP Folder Structure</h3><p>Here are the rules every KMP developer should memorize:</p><h4>Rule 1: The “Delete the androidApp Folder&quot; Test</h4><blockquote><em>If you delete the </em><em>androidApp folder, your </em><em>shared module should still compile perfectly.</em></blockquote><p>If it doesn’t compile, you’ve put Android-only code in the wrong place (likely commonMain or androidMain when it should be in androidApp).</p><h4>Rule 2: The “No Android SDK in commonMain&quot; Rule</h4><blockquote><em>commonMain cannot contain any Android SDK imports.</em></blockquote><p>If you see import android.* or import androidx.* in commonMain, move it. Use expect/actual to abstract Android-specific functionality.</p><h4>Rule 3: The “No UI in androidMain&quot; Rule</h4><blockquote><em>androidMain is for platform wiring, not UI.</em></blockquote><p>Jetpack Compose screens, Activities, and Android resources belong in androidApp, not androidMain.</p><h4>Rule 4: The “One Module, One Responsibility” Rule</h4><blockquote><em>The </em><em>shared module is a library. The </em><em>androidApp module is an application. They are not the same thing.</em></blockquote><p>Never mix app entry points with shared code in the same module. AGP 9.0 enforces this.</p><h4>Rule 5: The “Write iOS actuals Now&quot; Rule</h4><blockquote><em>Even if you’re not building an iOS app today, write the </em><em>iosMain implementations.</em></blockquote><p>This ensures your shared module is truly complete. When you eventually add an iOS app, the shared code will work immediately.</p><h3>Quick Reference: What Goes Where</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KvvQql89GVESB-KsScuYQA.png" /></figure><h3>Common Mistakes (And How to Avoid Them)</h3><h4><strong>❌ Mistake 1: Putting Compose UI in </strong><strong>androidMain</strong></h4><p>Wrong:</p><pre>// shared/src/androidMain/kotlin/com/cashi/ui/PaymentScreen.kt<br>@Composable<br>fun PaymentScreen() { ... }  // This is WRONG</pre><p>Why: androidMain is inside the shared library, not the app. UI belongs in androidApp.</p><p>Fix: Move UI code to androidApp/</p><h4>❌ Mistake 2: Importing Android SDK in commonMain</h4><p>Wrong:</p><pre>// shared/src/commonMain/kotlin/com/cashi/data/FirebasePaymentRepository.kt<br>import com.google.firebase.firestore.FirebaseFirestore  // Breaks iOS compilation!<br><br>class FirebasePaymentRepository {<br>    private val db = FirebaseFirestore.getInstance()  // Android-only!<br>}</pre><p>Why: commonMain compiles for iOS too. This code will fail on iOS.</p><p>Fix: Use expect/actual to abstract it.</p><h4>❌ Mistake 3: Using Context directly in commonMain</h4><p>Wrong:</p><pre>// shared/src/commonMain/kotlin/com/cashi/util/NetworkUtils.kt<br>fun isNetworkAvailable(context: Context): Boolean { ... }</pre><p>Why: Context doesn&#39;t exist on iOS.</p><p>Fix: Either use expect/actual to abstract it, or push it to androidApp if it&#39;s purely Android-specific.</p><h4>❌ Mistake 4: Putting business logic in androidApp</h4><p>Wrong:</p><pre>// androidApp/src/main/java/com/cashi/android/data/PaymentRepository.kt<br>class PaymentRepository {<br>    fun sendPayment(payment: Payment) { ... }  // This should be SHARED<br>}</pre><h3>The expect/actual Connection</h3><p>The folder structure and expect/actual are two sides of the same coin.</p><ul><li>commonMain contains the expect declarations—the &quot;contract&quot; that says &quot;this functionality exists on all platforms.&quot;</li><li>androidMain contains the actual implementations for Android—the &quot;how&quot; for that platform.</li><li>iosMain contains the actual implementations for iOS—the &quot;how&quot; for that platform.</li></ul><h3>The Big Takeaway</h3><p>The new KMP project structure isn’t just about following rules. It’s about clarity, maintainability, and scalability.</p><ul><li>androidApp is for Android UI</li><li>iosApp is for iOS UI</li><li>shared/commonMain is for shared logic</li><li>shared/androidMain is for Android platform wiring</li><li>shared/iosMain is for iOS platform wiring</li></ul><p>The Golden Rule: If you can delete the androidApp folder and your shared module still compiles, you&#39;ve done it right. If not, you&#39;ve put code in the wrong place.</p><p><em>Follow me on </em><a href="https://www.linkedin.com/in/emmanueldav/"><em>LinkedIn</em></a><em> and </em><a href="https://github.com/EmmanuelDav"><em>GitHub</em></a><em> for more KMP insights. If you found this helpful, share it with your team — they’ll thank you later.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5027f3c39925" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What’s Actually New in Kotlin Multiplatform and Compose Multiplatform in 2026]]></title>
            <link>https://emmanueldav.medium.com/whats-actually-new-in-kotlin-multiplatform-and-compose-multiplatform-in-2026-0ba10c61ac62?source=rss-b035fbc2b13c------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ba10c61ac62</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[compose-multiplatform]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <dc:creator><![CDATA[Iyke Emmanuel]]></dc:creator>
            <pubDate>Wed, 15 Jul 2026 13:55:23 GMT</pubDate>
            <atom:updated>2026-07-16T10:48:12.282Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5y3cHVNYxFHAQUaflViztg.png" /></figure><p>If you blinked sometime around May, you probably missed it. KotlinConf 2026 came and went, Kotlin 2.4.0 landed a few weeks later, and somewhere in between, Compose Multiplatform quietly crossed a line a lot of us have been waiting years to see.</p><p>For the past few years, almost every conversation around Kotlin Multiplatform has sounded the same.</p><p><em>“Is it production ready?”</em></p><p><em>“Should we wait another year?”</em></p><p><em>“Can we really ship apps with this?”</em></p><p>KotlinConf 2026 felt different.</p><p>Instead of asking developers to believe in a future version of KMP, JetBrains and Google spent most of the conference showing how much of that future has already arrived. K2 isn’t “the new compiler” anymore; it’s just Kotlin. Compose Multiplatform is running in production at companies like Sony. KSP2 has quietly become the standard. Jetpack libraries keep moving into shared code, and the tooling feels genuinely mature for the first time.</p><p>None of these changes alone is a huge deal. Stacked together, they’re one of the biggest jumps the ecosystem has made in a while. So here’s what actually changed and what’s worth paying attention to.</p><h3>It started at KotlinConf 2026</h3><p>This year’s keynote had a noticeably different energy. Past ones spent a lot of time convincing developers that KMP and CMP were worth betting on. This year, that pitch was basically gone, replaced by maturity, performance, and developer experience.</p><p>Kotlin Lead Language Designer Michail Zarečenskij opened with a preview of Kotlin 2.4.0: context parameters getting closer to stable, and explicit backing fields finally replacing the underscore-prefixed property trick most of us have used for years.</p><p>But the bigger story was Compose Multiplatform. JetBrains confirmed it’s fully stable and production-ready across Android, iOS, desktop, and web for supported cases, and backed that up with real production stories instead of demos. Sony’s Sound Connect app got its own session covering a six-year migration that ended with it replacing React Native with Compose Multiplatform. Amazon engineers talked through how they’re using KMP internally through their App Platform library. These aren’t side projects anymore; they’re products used by millions of people.</p><p>Google’s half of the keynote had its own quiet wins. K2 support in Android Studio is now near universal. KSP execution time dropped about 17% on complex builds. R8 picked up an optimization that strips unnecessary reflection around coroutine logging, which alone delivered roughly a 50% Compose performance improvement in benchmarks. None of that is flashy, but it’s the kind of thing you actually feel every day if you’re the one waiting on builds.</p><h3>K2 isn’t “the future” anymore; it’s just Kotlin</h3><p>Easy to miss, but worth calling out: nobody debated K2’s stability this year. It’s simply assumed to be part of your toolchain now, and nearly everything announced builds on top of it: faster incremental compilation, better IDE analysis, KSP2, and future language features included. If your project’s still avoiding K2 because it once felt experimental, that’s worth revisiting, since the ecosystem has clearly moved past that conversation.</p><h3>Kotlin 2.4 is polish, not fireworks</h3><p>Beyond context parameters and explicit backing fields, most of Kotlin 2.4 is quality-of-life work: better type inference, cleaner overload resolution, sharper compiler diagnostics, smoother Java interop, and faster compilation. Nothing here rewrites how you write Kotlin, but it continues a trend of the language getting steadily faster and more predictable release over release.</p><h3>AI quietly became part of the workflow</h3><p>Like every conference this year, KotlinConf had AI everywhere. JetBrains didn’t pitch it as a replacement for developers or launch another standalone assistant, though. The focus was on AI-assisted navigation, Kotlin-aware refactoring, and project-wide code understanding, basically reducing the repetitive parts of working in unfamiliar codebases rather than generating whole apps from a prompt.</p><h3>KMP: What actually changed under the hood</h3><h4>A cleaner default project structure</h4><p>The biggest quiet win here is something you’ll only notice when starting a new project. The old default had one composeApp module doing two jobs at once: holding shared logic and acting as the app entry point for every platform. As projects grew, it got messy fast.</p><p>The new structure separates it properly. A shared module now only holds shared Kotlin code. Each platform gets its own dedicated application module for packaging and setup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LTYEe1wWeWLd-gyR.png" /></figure><p>Android Studio&#39;s KMP shared module template already reflects this, and so does the wizard on kmp.jetbrains.com. If you&#39;ve ever had to explain to a teammate which parts of composeApp Were actually shared, this fixes that.</p><h4>Swift Export moves to Alpha</h4><p>Calling Kotlin from Swift has always meant going through an Objective-C bridge, and the result rarely felt like something a Swift developer would naturally write. Swift Export skips that bridge and generates APIs that map directly into Swift. It hit Alpha with Kotlin 2.4. Not production-ready yet, but a real signal of where iOS interop is heading.</p><p>Alongside it, Kotlin can now pull in Objective-C-compatible dependencies through Swift Package Manager directly, so you’re not hand-writing C interop bindings just to use a small Swift library anymore.</p><h4>Jetpack libraries keep expanding into commonMain</h4><p>Probably the most impactful change for Android developers specifically. Room, DataStore, ViewModel, Lifecycle, and Paging are all usable directly from commonMain now. That means the repositories, ViewModels, and persistence layer you already know how to build on Android can live in your shared module instead of needing a parallel multiplatform version. This is the single biggest reason the KMP learning curve has flattened for anyone coming from pure Android work.</p><h4>KSP2 stopped being optional</h4><p>KSP2 has technically been the default since early 2025, but 2026 is the year it stopped being a “someday” migration. Quick clarification since it trips people up: KSP2 isn’t K2, and it isn’t a replacement for Kotlin itself. K2 is the compiler. KSP2 is the annotation processing engine that libraries like Room and Hilt rely on to generate code.</p><p>The old implementation, KSP1, was tightly coupled to the compiler in a way that’s become hard to maintain as Kotlin evolved toward K2. KSP2 is a full rewrite built on the same compiler APIs used by IntelliJ IDEA and Android Lint, giving it better incremental builds and finer control over the build lifecycle. More importantly, KSP1 won’t fully support Kotlin 2.2 and up, and it’s incompatible with AGP 9 and newer. If you’re still on it, this year is the year to move, not next year.</p><h4>The IDE plugin finally works properly on Windows and Linux</h4><p>Until recently, the full KMP IDE experience was basically a Mac only thing, since Swift tooling and iOS run configs need Xcode anyway. JetBrains has rolled out real Windows and Linux support for the plugin, so teams on those platforms now get the wizard, preflight checks, and Compose Hot Reload without needing a Mac in the mix. iOS builds and Swift support still need macOS for obvious reasons, but everything else- Android, desktop, web, server- is consistent regardless of OS now.</p><h3>CMP: What changed in the UI layer</h3><p>While Kotlin Multiplatform has steadily improved behind the scenes, Compose Multiplatform arguably saw the biggest visible changes this year. The story is no longer about proving Compose can technically run across multiple platforms at all. It’s about refining the experience so applications genuinely feel native wherever they’re running, without giving themselves away</p><h4>Web reaches Beta</h4><p>Web support has matured considerably over the past year. Compose Multiplatform now targets WebAssembly by default, letting applications get much closer to native rendering performance than traditional JavaScript-based approaches ever managed. For browsers that don’t yet support modern Wasm features like garbage collection, applications automatically fall back to Kotlin/JS, so you’re not personally choosing between performance and broad compatibility every time you ship. Web isn’t quite at Android&#39;s or iOS’s maturity level yet, but it’s become a realistic option for dashboards, internal tools, and smaller production apps.</p><h4>Compose Hot Reload goes stable</h4><p>If you’ve spent years making tiny UI tweaks only to sit through another full application restart, this one will make you smile. Compose Hot Reload officially reached version 1.0 and now ships bundled directly into Compose Multiplatform, with no additional setup. Save your code, and the UI updates instantly while preserving state wherever possible, no restart, no lost context. It sounds small on paper, but across hundreds of UI iterations a week, those saved seconds add up fast.</p><h4>One unified @Preview annotation</h4><p>If you’ve worked with Compose Multiplatform over the past couple of years, you’ve probably run into one of those tiny annoyances that somehow wastes more time than it has any right to. There used to be multiple @Preview annotations, and depending on which platform or package you were working in, you had to remember which one belonged where. Never a major blocker, but one more small piece of friction.</p><p>That’s been cleaned up. Compose Multiplatform introduces a single unified @Preview annotation that works directly from your commonMain source set, regardless of which platform you’re ultimately targeting. Existing projects can also be migrated automatically using IDE quick fixes. It’s a small change on its own, but exactly the kind of polish that shows how much attention JetBrains is paying to the everyday developer experience.</p><h4>Navigation 3 goes multiplatform</h4><p>Navigation 3 shifts away from the old graph-based model toward direct back stack management, which makes things like auth flows, nested navigation, and deep links noticeably easier to reason about. It’s no longer Android-only either, so you get one consistent navigation model across Android, desktop, iOS, and web instead of maintaining a separate approach per platform.</p><h4>iOS performance took a real step forward</h4><p>Performance has always been one of the biggest open questions surrounding Compose Multiplatform on iOS. Could it actually match native SwiftUI? In a lot of areas, 2026 is the closest the ecosystem has come to answering that with genuine confidence.</p><p>JetBrains reported roughly 25% faster builds using less than half the memory compared to previous releases, measured against the Google Docs codebase internally. The CMS garbage collector is now enabled by default for Kotlin/Native, improving runtime behavior with no manual configuration needed. Interop views also gained automatic sizing, letting embedded UIKit components size themselves based on content instead of forcing developers to calculate dimensions by hand.Text input and scrolling finally feel native</p><p>Two of the most common complaints about Compose on iOS have both gotten real attention. Text editing is noticeably more responsive now with proper native text selection support. Scrolling has been reworked to match native iOS physics and display native framerates, so the slightly off feel that used to give away a Compose app is largely gone.</p><h4>Performance was the actual theme</h4><p>Across the whole conference, one thread kept showing up everywhere: performance. Faster KSP, faster Compose benchmarks through R8, faster Kotlin/Native builds, lower memory use, better incremental compilation, native feeling scrolling on iOS, Hot Reload going stable. None of these individually is dramatic. Together, they quietly remove most of the rough edges that used to make KMP feel like a technology you adopted despite the compromises rather than because of the wins.</p><h3>So what should you actually do?</h3><p>You don’t need to rewrite anything overnight, but a few moves are clearly worth prioritizing:</p><ul><li>Upgrade to Kotlin 2.4 and fully lean into K2 if you haven’t already</li><li>Migrate off KSP1 to KSP2 this year, not “eventually”</li><li>Adopt the new project structure for anything new you’re starting</li><li>Turn on Compose Hot Reload; it’s basically a free win</li><li>Move more shared logic into commonMain now that Room, ViewModel, Lifecycle, and Paging live there</li><li>Look at Navigation 3 if cross-platform navigation consistency matters to you</li></ul><h3>Final thought</h3><p>For years, KMP felt like a promise you kept being asked to believe in a little longer. KotlinConf 2026 didn’t have one single headline moment. It had a long list of previously experimental pieces that all quietly reached maturity at the same time. K2 is just Kotlin now. Compose Multiplatform is running at scale at real companies. KSP2 is the standard. The tooling finally works the same everywhere. For the first time in a while, recommending Kotlin Multiplatform doesn’t come with an asterisk attached.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ba10c61ac62" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android 17 App Memory Limits — The New “Strict Mode” for RAM]]></title>
            <link>https://emmanueldav.medium.com/android-17-app-memory-limits-the-new-strict-mode-for-ram-7b1cb2a9a7cc?source=rss-b035fbc2b13c------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b1cb2a9a7cc</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Iyke Emmanuel]]></dc:creator>
            <pubDate>Tue, 07 Jul 2026 17:17:00 GMT</pubDate>
            <atom:updated>2026-07-07T17:18:58.979Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*f_vvcg-PYnKc6RI_.jpeg" /></figure><h3>Introduction</h3><p>Android 17 (API level 37) introduces one of the most significant low-level changes to the platform in years: the system now enforces a <strong>per-app memory limit</strong>, based on the device’s total RAM. If your app crosses that limit, Android kills the process, and until recently, without a stack trace attached to the kill. This isn’t a warning you can dismiss or a lint suggestion. It’s hard enforcement, similar in spirit to how Android’s old “StrictMode” would flag disk/network calls on the main thread, except here, the OS doesn’t just flag the violation, it terminates the process.</p><p>Google’s stated goal is a “more stable and deterministic environment” for apps and users. The limits are intentionally conservative in this first release; they’re aimed at extreme memory leaks and outlier apps, not at typical, well-behaved memory usage. But as a developer, you still need to understand exactly how this works, why it exists, how to detect it, and how to make sure your app never gets caught by it</p><h3>The Problem Android 17 Solves: The “One Bad Actor”</h3><p>To understand why Google built this, it helps to understand the failure mode it’s replacing.</p><p><strong>Quick context:</strong> Android has always had a background process killer called the <strong>Low Memory Killer (LMK)</strong>. When the system runs low on RAM, the LMK kills cached/background apps to free up space. This is normal and has existed for years.</p><p>Here’s the gap that Android 17 closes. When an app is running a <strong>Foreground Service</strong> (think: a music player mid-playback, or a banking app syncing in the background), Android treats it as doing work the user actively cares about, so the LMK largely leaves it alone, even if it’s using a lot of memory.</p><p><strong>The problem</strong>: if that same foreground-service app has a memory leak or is simply bloated, it can keep growing unchecked. The LMK still needs to free RAM for the rest of the system, so instead of touching the protected app, it starts killing off <em>other</em>, well-behaved cached apps and background jobs to compensate.</p><p>The user-facing result is ugly:</p><ul><li>Apps you switch back to no longer “warm resume”; instead, they cold-start from scratch.</li><li>Scroll positions, navigation stacks, and unsaved state get wiped.</li><li>The battery drains faster because the system is constantly killing and relaunching processes instead of resuming them.</li></ul><p>In short: <strong>one misbehaving app degrades the entire device’s multitasking experience.</strong> Android 17’s memory limiter exists specifically to stop that one app before it can cause the cascade.</p><h3>How the Memory Limiter Works</h3><h4>Linux cgroup v2, briefly</h4><p>The memory limiter isn’t a Java/Kotlin-level heuristic running somewhere in the Android framework, it’s built on <strong>Linux cgroup v2</strong>, a kernel feature for grouping processes and capping their resource usage. This means the enforcement happens at the kernel level, below the Android runtime (ART) entirely. Your app has no visibility into it and no way to negotiate with it at runtime.</p><p>Two thresholds matter here:</p><ul><li><strong>memory.high</strong> — a soft ceiling. Once your app crosses it, the kernel actively starts reclaiming memory from your process and pushing some of its data to swap to bring it back under the limit.</li><li><strong>memory.swap.max</strong> — a hard cap on how much swap (compressed memory) your app is allowed to use once it&#39;s already over memory.high.</li></ul><p>Put together: the kernel first tries to <em>squeeze</em> your app back into budget via swap, and only kills it once that squeeze also runs out of room.</p><h4>What gets enforced</h4><ul><li>The limiter applies to <strong>application processes</strong> (UID ≥ 10000, this is just how Android identifies “installed app,” as opposed to system processes). System processes are generally exempt, since the platform itself needs to keep functioning.</li><li>The actual limit is based on the <strong>device’s total RAM </strong>a 4GB device gets a tighter cap than a 12GB flagship. Google hasn’t published exact numbers per device tier; the limits are described as conservative and may be tuned over time.</li></ul><h4>What happens when you exceed it</h4><p>If your process crosses the limit, Android terminates it. The important part for debugging:</p><ul><li>The kill shows up as ApplicationExitInfo.REASON_OTHER Not one of the more specific, self-explanatory exit reasons you might already be handling.</li><li>The description field contains the string &quot;MemoryLimiter:AnonSwap&quot;.</li><li>Earlier reporting suggested these kills came with <em>no</em> stack trace at all that’s been clarified: Android 17 does record the exit reason above, but you won’t get a conventional crash-style stack trace pointing at the exact line that caused it. You get “this process was terminated for memory reasons,” not “this specific allocation broke the limit.”</li></ul><p>This is the crux of why this feature demands attention: without actively checking for it, an affected session just looks like the app closed. No crash report lands in your dashboard the way a NullPointerException would.</p><h3>Detecting Memory Limit Kills</h3><h4>Reading ApplicationExitInfo</h4><p>You can check retroactively whether a past session of your app was killed by the memory limiter:</p><pre>val activityManager = getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager<br>val exitInfos = activityManager.getHistoricalProcessExitReasons(null, 0, 0)<br><br>exitInfos.forEach { info -&gt;<br>    if (info.reason == ApplicationExitInfo.REASON_OTHER) {<br>        val description = info.description<br>        if (description?.contains(&quot;MemoryLimiter:AnonSwap&quot;) == true) {<br>            // This session was terminated by the Android 17 memory limiter,<br>            // not by a crash, ANR, or user swipe-away.<br>            Log.w(&quot;MemoryMonitor&quot;, &quot;App killed by MemoryLimiter: $description&quot;)<br>        }<br>    }<br>}</pre><p>Practical tip: call this on app startup (e.g, in your Application class or a startup WorkManager job) and pipe matches into whatever crash/analytics tool you already use (Firebase Crashlytics, Sentry, etc.), tagged distinctly from real crashes. Otherwise, these kills silently inflate your &quot;unexplained app closures&quot; numbers without anyone knowing why.</p><h4>Trigger-based profiling with TRIGGER_TYPE_ANOMALY</h4><p>Beyond detecting <em>that</em> a kill happened, Android 17 also lets you capture <em>why</em> via a new profiling trigger that automatically takes a heap dump the moment the memory limit is hit, through the ProfilingManager API. Instead of trying to reproduce a leak manually on your own device, you get the actual memory snapshot from the moment your app crossed the line, straight from a real user session in the field.</p><p>This is genuinely new: previously, “capture a heap dump at the exact moment of an OOM” wasn’t something you could ask the platform to do for you automatically in production you’d have to either reproduce it locally or rely on the app already knowing it was in trouble (which, by definition, a leak-driven kill doesn’t tell you in advance).</p><h3>Testing Your App Under Memory Constraints</h3><p>Android 17 ships adb subcommands under am memory-limiter Specifically, so you can simulate this locally instead of waiting for it to happen to a real user. These commands are no-ops on devices that don&#39;t enforce limits, so they&#39;re safe to leave in test scripts.</p><p><strong>1. </strong><strong>am memory-limiter ignore</strong></p><p>Tells the limiter to stop enforcing on some or all processes, useful when you want to isolate a <em>different</em> variable and rule out the limiter as a factor:</p><pre># Ignore a specific UID<br>adb shell am memory-limiter ignore &lt;uid&gt;<br><br># Ignore all apps<br>adb shell am memory-limiter ignore all<br><br># Reset — stop ignoring<br>adb shell am memory-limiter ignore none</pre><p>Note: even if a UID is set to “ignore,” you can still layer a manual limit on top for a specific process (see next command). “Ignore” turns off the <em>system default</em>, it doesn’t block you from setting your own.</p><p><strong>2. </strong><strong>am memory-limiter manual</strong></p><p>This is the one you’ll actually use for testing, it lets you impose an artificial, tighter-than-normal limit on a specific process by PID, so you can deliberately trigger the kill path and watch how your app responds:</p><pre># Limit a specific process (by PID) to 30 MB<br>adb shell am memory-limiter manual &lt;pid&gt; 30<br><br># Remove all memory limits on that process<br>adb shell am memory-limiter manual &lt;pid&gt; max<br><br># Clear manual override, fall back to the system default limit<br>adb shell am memory-limiter manual &lt;pid&gt; none</pre><p><strong>3. </strong><strong>am memory-limiter status</strong></p><p>Reports the current limiter state, what limits are currently applied to visible vs. non-visible (background) processes. Useful as a sanity check before and after running the commands above.</p><p>A practical testing workflow</p><ol><li>Profile your app’s baseline memory usage under normal use (Android Studio Profiler).</li><li>Deliberately stress it, load a batch of large images, hold onto large lists, whatever mirrors your app’s real risk areas.</li><li>Use am memory-limiter manual &lt;pid&gt; 50 To impose a tight artificial ceiling and watch what happens, does your app degrade gracefully, or does it die abruptly mid-flow?</li><li>Combine with TRIGGER_TYPE_ANOMALY profiling so you capture a heap dump right as the limit is hit, instead of guessing after the fact.</li><li>Inspect the heap dump for the actual retained objects, this is where you’ll usually find your real culprit (an unclosed listener, a cached bitmap, a growing collection).</li></ol><h4>The Silent Kill: Why This Matters</h4><p>The core risk here isn’t the limit itself, it’s the lack of an obvious signal when you cross it. A conventional crash gives you a stack trace pointing at a line of code. A memory-limiter kill gives you REASON_OTHER and a description string, informative once you know to look for it, but invisible if you&#39;re not actively checking ApplicationExitInfo.</p><p>Practically, this means: <strong>memory management stops being purely a performance/UX concern and becomes a stability requirement.</strong> An app that “works fine” in manual testing on a flagship device can still get silently killed in production on a lower-RAM device, and unless you’ve wired up detection, you’ll only find out because users start reporting the app “just closes” — with nothing concrete for you to act on.</p><h4>Strategies to Stay Under the Limit</h4><p>Google’s own recommendations, in order of typical impact-to-effort ratio:</p><ul><li><strong>Enable R8 in full mode.</strong> Beyond obfuscation, R8’s shrinking pass removes unused classes/methods and renames what’s left, which reduces the resident bytecode ART has to keep loaded, smaller baseline footprint before you’ve even started doing work.</li><li><strong>Be deliberate about image loading.</strong> Bitmaps are usually the single biggest memory cost in a typical app, a small compressed JPEG can expand to several MB once decoded to raw pixels. Use an image loading library (Coil for Compose-based codebases, Glide for View-based/Java) rather than manual BitmapFactory calls, and downsample via inSampleSize Instead of loading full resolution into a thumbnail-sized view.</li><li><strong>Find leaks before shipping.</strong> Use LeakCanary (now integrated into Android Studio’s Memory Profiler) during QA, not just ad hoc profiling when something looks off.</li><li><strong>Implement </strong><strong>onTrimMemory().</strong> This callback tells your Activity/Fragment/Service when the system is under memory pressure, use it to proactively drop caches (image caches, precomputed data) rather than waiting to get killed.</li><li><strong>Use </strong><strong>ProfilingManager&#39;s anomaly trigger in production.</strong> This gives you the &quot;why&quot; behind field kills without needing a user to file a bug report first.</li></ul><h4>A Few More Things Worth Knowing</h4><ul><li><strong>Baseline Profiles</strong> (AOT-compiling your app’s hot code paths ahead of time) reduce some runtime memory overhead as a side effect of reducing JIT compilation work at startup not a memory feature per se, but it stacks with the above.</li><li><strong>“AnonSwap”</strong> in the kill description specifically refers to <em>anonymous</em> memory, i.e., your heap allocations, as opposed to memory-mapped files. If you’re chasing this down, your heap is the first place to look, not your APK’s asset files or native libraries.</li><li><strong>Test on genuinely low-RAM devices</strong>, not just emulators configured to <em>report</em> less RAM. If your app is comfortable on a 12GB device but bloated on a 4GB one, the 4GB tier is where these limits will actually bite you and that’s very likely a meaningful chunk of your real user base, not just an edge case.</li></ul><h3>Conclusion</h3><p>Android 17’s memory limits are a genuine architectural shift, not a minor API addition. They’re enforced at the kernel level via Linux cgroup v2, which means there’s no userspace workaround, your app either fits within its budget or it gets killed.</p><p>The practical takeaway: treat ApplicationExitInfo monitoring as a standard part of your observability stack going forward, the same way you already track crash rate and ANR rate. Pair that with the am memory-limiter commands during QA to deliberately provoke the failure mode before your users do. Google has given you the tooling TRIGGER_TYPE_ANOMALY for field diagnostics, am memory-limiter for local testing — the rest is on you to wire in.</p><p>This is effectively “Strict Mode” for RAM. And unlike the old StrictMode, there’s no way to silence the violation — only to make sure you never trigger it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b1cb2a9a7cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ADK vs. Koog: The Two AI Agent Frameworks Every Kotlin Developer Needs to Know]]></title>
            <link>https://emmanueldav.medium.com/adk-vs-koog-the-two-ai-agent-frameworks-every-kotlin-developer-needs-to-know-959e5238fd57?source=rss-b035fbc2b13c------2</link>
            <guid isPermaLink="false">https://medium.com/p/959e5238fd57</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[gemini]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Iyke Emmanuel]]></dc:creator>
            <pubDate>Wed, 01 Jul 2026 17:50:39 GMT</pubDate>
            <atom:updated>2026-07-01T17:50:39.982Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xduCXukatEfmGITGmmeejg.png" /></figure><p>You’ve been hearing about AI agents everywhere. Everyone’s building them. And now Google and JetBrains just dropped two new frameworks that let you build them in Kotlin.</p><p>But which one should you actually use?</p><p>Let me break it down</p><h3>What Is ADK?</h3><p>ADK stands for Agent Development Kit. Google released it at Google I/O 2026.</p><p>Think of ADK as Google’s official way to build AI agents on Android. It’s deeply integrated with Gemini — especially Gemini Nano, which runs entirely on your phone.</p><p>What it does:</p><ul><li>You create a “master” agent that understands what the user wants</li><li>That master agent delegates tasks to smaller “sub-agents”</li><li>For example: “Book me a flight” → master agent sends that to a FlightAgent</li><li>The FlightAgent checks availability, finds prices, and books it</li></ul><p><strong>The magic</strong>: Everything can happen on-device. Your data never leaves the phone. And Gemini handles the heavy lifting.</p><p><strong>Who it’s for</strong>: Android developers building AI-powered apps. If you want to add AI to your app and you’re using Gemini, ADK is the path of least resistance.</p><h3>What Is Koog?</h3><p>Koog is JetBrains’ new open-source framework. It dropped at KotlinConf 2026.</p><p>Think of Koog as the Swiss Army knife of AI agents. It’s model-agnostic — meaning it works with any AI model, not just Gemini. It’s multiplatform — you can run it on Android, iOS, backend servers, even web browsers.</p><p><strong>What it does:</strong></p><ul><li>You define the agent’s workflow step by step</li><li>Step 1: Parse user input</li><li>Step 2: Query the database</li><li>Step 3: Generate a response</li><li>Step 4: Log everything</li><li>If Step 2 fails, go to Step 5</li></ul><p>Koog gives you <strong>precise control</strong> over every step. It also saves the agent’s “memory” — so if your server crashes, the agent can resume exactly where it left off.</p><p><strong>Who it’s for</strong>: Kotlin developers building agents across platforms. If you’re building a backend service, a web app, or an enterprise system, Koog is built for you.</p><h3>The Key Difference</h3><p>ADK: Made by Google. Best for Android apps. Gemini only. High-level delegation. Session-based.</p><p>Koog: Made by JetBrains. Best for backend and multiplatform. Any model. Step-by-step control. Built-in persistence.</p><h3>Which One Should You Use?</h3><p><strong>Choose ADK if:</strong></p><ul><li>You’re building a native Android app</li><li>You want deep Gemini integration</li><li>You don’t want to worry about model selection</li><li>You want something that “just works” with minimal setup</li></ul><p><strong>Choose Koog if:</strong></p><ul><li>You’re building agents across Android, iOS, and backend</li><li>You want to use multiple AI models (OpenAI, Anthropic, open-source)</li><li>You need precise control over the agent’s workflow</li><li>You need the agent to survive crashes and resume long-running tasks</li><li>You’re building enterprise-grade systems</li></ul><h3>The Bottom Line</h3><p>Google and JetBrains are both investing heavily in AI agents on Kotlin. That’s good news for us developers.</p><p>ADK is simpler and Android-first. Koog is more powerful and multiplatform.</p><p>The good news? You can’t really go wrong. Both are production-ready. Both are supported by major companies. Both will get better over time.</p><p>Pick the one that fits your use case today. If you’re building an Android app with Gemini, start with ADK. If you’re building anything else — or you want flexibility — start with Koog.</p><p>Either way, you’re building the future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=959e5238fd57" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rokarolla: What Every Android Developer Needs to Know About the 2026 Trojan That Takes Over Your…]]></title>
            <link>https://emmanueldav.medium.com/rokarolla-what-every-android-developer-needs-to-know-about-the-2026-trojan-that-takes-over-your-11f882479dcb?source=rss-b035fbc2b13c------2</link>
            <guid isPermaLink="false">https://medium.com/p/11f882479dcb</guid>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[mobile-banking]]></category>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[android-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Iyke Emmanuel]]></dc:creator>
            <pubDate>Sat, 27 Jun 2026 23:17:27 GMT</pubDate>
            <atom:updated>2026-06-28T00:25:33.494Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SzXPk1KPh9hd7Z0q6zqPIQ.png" /></figure><h3>Rokarolla: What Every Android Developer Needs to Know About the 2026 Trojan That Takes Over Your Users’ Phones</h3><p>You spent months building your banking app. You followed every security guideline. SSL pinning. Obfuscation. Biometric authentication.</p><p>You thought you were safe.</p><p>Then Rokarolla arrived. And it didn’t care about any of that.</p><p>It didn’t hack your app. It hacked your users. And there’s no security patch for that.</p><p>Open Twitter right now. You’ll find screenshots — account dashboards wiped clean, balances at zero. And the comments are all saying the same thing:</p><p><em>“I never shared my PIN.”</em></p><p><em>“I never clicked any suspicious link.”</em></p><p><em>“I don’t know how they did it.”</em></p><p>They’re telling the truth. Every single one of them.</p><p>Their phones — the one device they trusted with their entire financial life — had been quietly weaponized against them. No phishing email. No fake link. Just an app they thought was Chrome or TikTok, and a trojan that did the rest.</p><p>In June 2026, Zimperium’s zLabs documented it officially. <strong>Rokarolla</strong> targets <strong>217 banking and crypto apps</strong>, runs <strong>137 remote commands</strong> on your device, and the first thing it does after installation is disable Google Play Protect.</p><p>SMS OTPs won’t stop it. SSL pinning won’t stop it. Play Protect won’t stop it — because Rokarolla kills it first.</p><p>This article is for Android developers who want to understand exactly how Rokarolla works, and what you can actually build to protect your users before it’s too late.</p><h3><strong>What Is Rokarolla?</strong></h3><p>Rokarolla was discovered in June 2026 by Zimperium’s zLabs team. It’s not your average banking trojan — it’s a full device takeover platform disguised as simple malware.</p><p>Here are the numbers that matter:</p><ul><li>217 banking and cryptocurrency apps targeted (<em>that means 217 banks and cryptocurrency app login pages and dashboards have already been cloned by this trojan and are just waiting to encounter users who have the targeted apps on their device</em>)</li><li>137 remote commands the attacker can execute</li><li>1 critical permission that makes it all possible: Accessibility Service</li></ul><p>For context, the notorious HOOK trojan had 107 commands. Rokarolla has 137. This thing is more powerful than anything we’ve seen in years.</p><p>But here’s what makes Rokarolla genuinely terrifying: it doesn’t just steal your data. It isolates you from help.</p><blockquote>“The Rokarolla trojan marks a shift from data theft to victim isolation… turning the phone into a weapon against its owner.”<em> — Jason Soroko, Sectigo</em></blockquote><p>Your fraud team can call the customer. Rokarolla will block the call. Your OTP will be sent. Rokarolla will intercept it. Your customer will have no idea anything is wrong until the money is gone.</p><h3>The Infection Chain: How It Gets In</h3><p>Understanding the infection chain is the first step to building defenses against it.</p><h4>Step 1: The Lure</h4><p>Rokarolla spreads through malicious websites that disguise themselves as legitimate app download pages. The two most common lures right now are:</p><ul><li>Fake TikTok download pages</li><li>Fake Google Chrome download pages</li><li>Recently, fake World Cup 2026 streaming apps have also been spotted</li></ul><p>The user downloads what looks like a normal app. It’s not.</p><h4>Step 2: The Dropper</h4><p>The downloaded app is a <strong>dropper</strong> — it’s designed to install the actual malware. Here’s the clever (and evil) part: the dropper disguises itself as <strong>Google Play Protect</strong>.</p><p>Yes, you read that right. The malware pretends to be Android’s own security service. The user sees a legitimate-looking “Google Play Protect” installer and thinks nothing of it.</p><h4>Step 3: The Critical Permission</h4><p>During installation, the dropper requests Accessibility Service permissions.</p><p>This is the moment everything changes.</p><p>Accessibility Service is designed to help visually impaired users interact with their phones. It can read screen content, simulate taps, and control the device. But in the wrong hands, it becomes a complete backdoor.</p><p>If the user grants this permission — and they do, because the app looks legitimate and the request looks normal — the dropper can now:</p><ul><li>Install the real Rokarolla payload silently in the background</li><li>Disable Google Play Protect</li><li>Hide its own icon from the app drawer</li></ul><p>The user never sees it coming. By the time they open their banking app, their phone is already compromised.</p><h3>How Rokarolla Attacks Your App</h3><p>Now let’s get technical. Once Rokarolla has Accessibility permissions, here’s exactly how it attacks your app.</p><h4>1. Overlay Attacks (Tapjacking)</h4><p>This is the primary attack method. When the user opens your banking app, Rokarolla checks if your app is on its target list (it probably is — 217 apps are targeted).</p><p>If it is, Rokarolla downloads a fake HTML login page from its command server and displays it directly on top of your app’s login screen.</p><p>The user doesn’t know they’re looking at a fake screen. They type their username, password, and OTP into what looks like your app. But every keystroke goes straight to the attacker.</p><p>What makes this worse: The overlay can be pixel-perfect. Your developers spent months making your login screen look beautiful and trustworthy. Rokarolla can copy it exactly. The user has no way to distinguish the real screen from the fake one.</p><h4>2. Keylogging</h4><p>With Accessibility permissions, Rokarolla records every single keystroke the user makes — not just on your app, but on the entire device.</p><p>This means:</p><ul><li>Your app’s PIN is captured</li><li>Your app’s password is captured</li><li>The OTP from your 2FA screen is captured</li><li>The device unlock PIN is captured</li></ul><h4>3. SMS Interception</h4><p>Rokarolla becomes the default SMS handler on the device. This means:</p><ul><li>It reads all incoming SMS messages (including OTP codes)</li><li>It can send SMS messages on behalf of the victim</li><li>It can delete SMS messages to hide evidence</li></ul><p>Your SMS-based 2FA is completely useless against Rokarolla. The OTP is intercepted before the user even sees it.</p><h4>4. Call Blocking</h4><p>This is the one that really hurts.</p><p>Rokarolla can intercept incoming calls. When your bank’s fraud team calls to verify a suspicious transaction, the call simply never reaches the customer. The malware can block the call, send a fake “call failed” message, and the customer never knows they were being alerted.</p><h4>5. Clipboard Hijacking</h4><p>This is a clever one. If the user copies a cryptocurrency wallet address (to make a transfer), Rokarolla silently replaces it with the attacker’s address in the clipboard.</p><p>The user pastes, confirms, and sends money directly to the attacker. No amount of 2FA will stop this — the user is authorizing what they believe is a legitimate transaction.</p><h3>What You Can Actually Do: Practical Defenses for Developers</h3><p>Alright, enough doom and gloom. Let’s talk about what you can do to protect your users.</p><h4>Defense #1: Prevent Tapjacking with filterTouchesWhenObscured</h4><p>This is your first line of defense, and it’s embarrassingly easy to implement.</p><p>For each sensitive view in your app (login screens, transaction screens, PIN entry screens):</p><pre>view.setFilterTouchesWhenObscured(true);</pre><p>Or in your XML layout:</p><p><strong>xml</strong></p><pre>android:filterTouchesWhenObscured=&quot;true&quot;</pre><p><strong>compose</strong></p><pre>fun Modifier.filterTouchesWhenObscured(): Modifier = this.then(<br>    Modifier.pointerInteropFilter(<br>        requestDisallowInterceptTouchEvent = null<br>    ) { motionEvent -&gt;<br>        if (motionEvent.flags and MotionEvent.FLAG_WINDOW_IS_OBSCURED != 0<br>            || motionEvent.flags and MotionEvent.FLAG_WINDOW_IS_PARTIALLY_OBSCURED != 0) {<br>            true<br>        } else {<br>            false<br>        }<br>    }<br>)</pre><p>What this does: When your view is completely covered by an overlay, the system discards touch events. The user can’t interact with the fake overlay through your app.</p><p>Important note: This only protects against full overlays. For partial overlays, you need to handle FLAG_WINDOW_IS_PARTIALLY_OBSCURED manually.</p><h4>Defense #2: Android 12+ Overlay Protection</h4><p>If your minSdkVersion is API level 31 (Android 12) or higher, you can use:</p><pre>window.setHideOverlayWindows(true);</pre><p>This forces your app’s window to stay on top of any overlays when your app is in the foreground.</p><p>Pro tip: Implement this in your onResume() method to ensure protection whenever your app becomes active.</p><h4>Defense #3: Detect Obscured Windows</h4><p>Monitor when your app loses focus and check if another window is covering it:</p><pre>@Override<br>protected void onPause() {<br>    super.onPause();<br>    // Check if your app is being obscured<br>    if (!isFinishing()) {<br>        // Log this event<br>        // Consider showing a warning to the user<br>        // Consider locking the session<br>    }<br>}</pre><p>For more robust detection, use getWindow().getDecorView().getRootView().getWindowToken() and check for WindowManager.LayoutParams.FLAG_WINDOW_IS_PARTIALLY_OBSCURED.</p><h4>Defense #4: Detect Active Accessibility Services</h4><p>This is where you can identify if the device has been compromised:</p><pre>AccessibilityManager am = (AccessibilityManager) getSystemService(Context.ACCESSIBILITY_SERVICE);<br>List&lt;AccessibilityServiceInfo&gt; services = am.getEnabledAccessibilityServiceList(<br>    AccessibilityServiceInfo.FEEDBACK_ALL_MASK);</pre><p><strong>What to do with this:</strong></p><ul><li>Check if any suspicious or newly installed accessibility services are active</li><li>Compare against a whitelist of trusted services (like TalkBack)</li><li>If you detect something suspicious, consider:<br> — Showing a warning to the user<br> — Blocking sensitive screens<br> — Requiring additional authentication</li></ul><p>Whitelist approach:</p><pre>List&lt;String&gt; whitelist = Arrays.asList(<br>    &quot;com.android.talkback/.TalkBackService&quot;,<br>    &quot;com.google.android.marvin.talkback/.TalkBackService&quot;<br>);<br>// Verify only whitelisted services are active<br>// If any unknown service is active, trigger a security response</pre><h4>Defense #5: Detect Recently Installed Suspicious Apps</h4><p>There’s a GitHub PoC that shows how to detect apps that:</p><ul><li>Were installed in the last 15 minutes</li><li>Have Accessibility Service enabled</li><li>Match a known suspicious package list</li></ul><pre>Set&lt;String&gt; recentlyInstalled = detector.getAvailabilityServicesInstalledInLastQuarter();<br>Set&lt;String&gt; suspiciousEnabled = detector.getSuspiciousAccessibilityServicesEnabled();<br>// If there&#39;s overlap → likely malware</pre><p>Implementing a similar check can give you a real-time indicator that the device is compromised.</p><h4>Defense #6: Kill SMS OTPs (Seriously, Do This)</h4><p>I can’t stress this enough: <strong>SMS-based 2FA is dead against Rokarolla.</strong></p><p>If you’re still using SMS OTPs, you need to migrate to:</p><ul><li><strong>Authenticator apps </strong>(Google Authenticator, Microsoft Authenticator, etc.)</li><li><strong>Push-based authentication</strong> with visual confirmation</li><li><strong>Biometric authentication</strong> where supported</li><li><strong>Cryptographic authentication </strong>with device and SIM binding</li></ul><p>A lot of fintech companies are slowly migrating their authentication flow away from SMS. It’s not just about Rokarolla — it’s about the broader trend of SMS interception attacks.</p><h4>Defense #7: Consider RASP Solutions</h4><p>Runtime Application Self-Protection (RASP) solutions like Appdome and Malwarelytics offer:</p><ul><li>Cloaking accessibility events (preventing accessibility services from reading interactions)</li><li>Real-time monitoring for unauthorized accessibility service usage</li><li>Automatic overlay detection and blocking</li><li>Device integrity checks</li></ul><p>These aren’t free, but for banking apps, the cost is justified.</p><h4>Defense #8: Code Hardening</h4><p>While this won’t stop Rokarolla directly, it makes your app harder to reverse-engineer:</p><ul><li>Obfuscate your code (replace class/method names with random strings)</li><li>Encrypt API keys (decrypt them at runtime only)</li><li>Implement certificate pinning (prevent MITM attacks)</li><li>Implement root/jailbreak detection</li></ul><h3>From my experience securing financial apps, here’s what I recommend implementing:</h3><p>1.<strong> Overlay detection</strong>: Add `filterTouchesWhenObscured` to all sensitive views in your app.<br>2.<strong> Accessibility monitoring</strong>: Add checks for active accessibility services and flag suspicious ones.<br>3. <strong>Authentication upgrade:</strong> Accelerate migration away from SMS OTPs to authenticator apps and push-based authentication.<br>4. <strong>User education</strong>: Update security communications to warn customers about sideloading and Accessibility permissions.<br>5. <strong>Fraud team protocol</strong>: Update fraud team protocols to handle cases where customers’ calls are being blocked.</p><p><strong>The reality</strong>: You can’t stop users from sideloading apps. You can’t stop them from granting permissions. But you can build apps that protect them even when their device is compromised.</p><h3>A Quick Note on Flutter Development</h3><p>If you’re building Flutter apps, here are some specific packages that can help:</p><p><strong>fraud_protection</strong> — Detects abusive accessibility services, blocks overlay touches, identifies obscured touches</p><p><strong>flutter_defender</strong> — Hardens Android screens against overlay-based tapjacking</p><p>These packages wrap the native Android solutions in a Flutter-friendly API.</p><h3>Security Checklist for Your App</h3><p>Here’s a practical checklist you can use to audit your app:</p><p><strong>Security Checklist for Your App</strong></p><p><strong>🔴 Critical Priority<br></strong>- Set `filterTouchesWhenObscured=true` on all sensitive views (UI)<br>- Use `setHideOverlayWindows(true)` on Android 12+ (UI)<br>- Replace SMS OTPs with authenticator apps (Auth)</p><p>🟡 <strong>High Priority</strong><br>- Detect when app is obscured by overlays (Monitoring)<br>- Check for active accessibility services (Monitoring)<br>- Implement biometric authentication (Auth)</p><p>🟠 Medium Priority<br>- Flag recently installed suspicious apps (Monitoring)<br>- Obfuscate your code (Hardening)<br>- Implement certificate pinning (Hardening)</p><p>⚪ Optional<br>- Consider RASP (Runtime Application Self-Protection) solutions</p><h3>The Bigger Picture: What This Means for Mobile Banking</h3><p>Rokarolla represents a shift in the threat landscape. Attackers aren’t just trying to steal data anymore — they’re trying to take over devices completely.</p><p>For developers, this means we need to think differently about security. We can’t rely on platform-level defenses alone. We need to build security directly into our applications.</p><p>For banks, this means we need to rethink our fraud prevention strategies. If the customer’s phone is compromised and their calls are being blocked, traditional fraud prevention fails.</p><h3>Conclusion</h3><p>Rokarolla is a serious threat. It’s sophisticated, it’s powerful, and it’s already in the wild targeting banking apps.</p><p>But as developers, we’re not helpless. We have tools at our disposal — from filterTouchesWhenObscured to accessibility monitoring to moving beyond SMS OTPs—that can protect our users even when their devices are compromised.</p><p>The key is defense in depth. No single protection will stop Rokarolla. But combining multiple layers — overlay detection, accessibility monitoring, authentication upgrades, and code hardening — creates a strong defense that significantly reduces the risk.</p><p>If you’re building an Android app that handles sensitive financial data, don’t wait for a customer to walk into your branch with that hollow look on their face.</p><p>Start implementing these defenses today.</p><h3>References and Further Reading</h3><ol><li>Zimperium zLabs (Original Report) — <a href="https://zimperium.com/blog/rokarolla-android-banker-with-complete-device-takeover-capabilities">https://zimperium.com/blog/rokarolla-android-banker-with-complete-device-takeover-capabilities</a></li><li>The Hacker News — <a href="https://thehackernews.com/2026/06/new-rokarolla-android-malware-steals.html">https://thehackernews.com/2026/06/new-rokarolla-android-malware-steals.html</a></li><li>InfoSecurity Magazine — <a href="https://www.infosecurity-magazine.com/news/rokarolla-android-banking-trojan">https://www.infosecurity-magazine.com/news/rokarolla-android-banking-trojan</a></li><li>The Next Web — <a href="https://thenextweb.com/news/rokarolla-android-banking-trojan-217-apps-device-takeover">https://thenextweb.com/news/rokarolla-android-banking-trojan-217-apps-device-takeover</a></li><li>Help Net Security — <a href="https://www.helpnetsecurity.com/2026/06/17/rokarolla-android-banking-trojan-device-takeover">https://www.helpnetsecurity.com/2026/06/17/rokarolla-android-banking-trojan-device-takeover</a></li><li>Android Developers — Tapjacking — <a href="https://developer.android.google.cn/privacy-and-security/risks/tapjacking">https://developer.android.google.cn/privacy-and-security/risks/tapjacking</a></li><li>fraud_protection Flutter Package — <a href="https://pub.dev/packages/fraud_protection">https://pub.dev/packages/fraud_protection</a></li><li>Malwarelytics Tapjacking Protection — <a href="https://developers.wultra.com/components/malwarelytics-android/develop/documentation/Tapjacking-Protection">https://developers.wultra.com/components/malwarelytics-android/develop/documentation/Tapjacking-Protection</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11f882479dcb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Unit Testing In Android (Part One): Understanding the basics]]></title>
            <link>https://emmanueldav.medium.com/introduction-to-unit-testing-in-android-part-one-understanding-the-basics-cf24640bed45?source=rss-b035fbc2b13c------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf24640bed45</guid>
            <category><![CDATA[mockito]]></category>
            <category><![CDATA[unit-testing]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-testing]]></category>
            <category><![CDATA[software-testing]]></category>
            <dc:creator><![CDATA[Iyke Emmanuel]]></dc:creator>
            <pubDate>Mon, 17 Mar 2025 20:56:34 GMT</pubDate>
            <atom:updated>2025-03-18T07:54:50.086Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Af8GlTyu9PnLKFCZ" /></figure><blockquote><strong>“If you are not writing test you are writing an instant legacy code”</strong></blockquote><p>Those words came from one of the most brilliant Software Engineer I’ve had the privilege to work with. As engineers, testing isn’t optional — it’s essential.</p><p>Today, we’re diving into <strong>unit testing in Android</strong> — whether you’re writing your first test or looking to level up your testing skills. Let’s get started!</p><h4>What are unit tests in Android?</h4><p>Unit testing refers to testing individual “units” of code, usually functions or methods, in isolation from the rest of the application. this ensures your code/function works as expected on its own and that it passes certain conditions independently.</p><p>Think of unit testing as checking each small part of your program, like individual building blocks, to make sure they work exactly as intended. Instead of testing the whole house, you’re checking each brick, window, and door separately. Specifically, you’re testing individual pieces of code, usually small functions, to see if they produce the right results when you give them certain inputs</p><h4>Why is Unit Testing Important?</h4><ul><li><strong>Detects Bugs Early</strong>: It lets you catch mistakes early before they cause bigger problems later. Imagine finding a cracked brick before the whole wall is built.</li><li><strong>Confidence In Code Reliability</strong>: It gives you confidence that each piece of your program is reliable. If each part works, the whole program is more likely to work under any environment</li><li><strong>Easy to Refactor: </strong>It makes it easier to change or update your code in the future. If you know each piece works on its own, you can make changes without worrying about breaking everything else.</li><li><strong>Concrete documentation: </strong>It acts as a form of documentation, showing exactly how each function should behave.</li></ul><h4>Setting up your project for unit tests</h4><p>To start unit testing in your Android project, you’ll need to add some dependencies to your build.gradle file. Here’s a list of the key libraries that are commonly used:</p><pre>dependencies {<br>    // JUnit for unit testing<br>    testImplementation &#39;junit:junit:4.13.2&#39;<br><br>    // Coroutine testing library<br>    testImplementation &quot;org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3&quot;<br><br>    // Mockito for mocking objects<br>    testImplementation &#39;org.mockito:mockito-core:5.5.0&#39;<br>    testImplementation &#39;org.mockito.kotlin:mockito-kotlin:5.1.0&#39; // Kotlin-friendly version<br><br>    // MockK for Kotlin-specific mocking<br>    testImplementation &quot;io.mockk:mockk:1.13.8&quot;<br>}</pre><p>So, where do we actually write these tests? In Android, you’ll find two key places, depending on the type of testing you’re doing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/0*YAw3NLh3CJfoGJMY.png" /></figure><ul><li><strong>Unit Test:</strong> These are the smallest and fastest tests that focus on testing a single component or function in isolation. They are meant to verify that individual parts of your code (like methods or classes) work as expected. They are written inside the test directory</li><li><strong>Integrated Test</strong>: These tests check the interaction between multiple components or classes to ensure they work together correctly. For example, you might test how a repository interacts with a data source or how a ViewModel interacts with a repository. they are written in the src/androidTest directory if they require Android components. If they don&#39;t require Android components, they can also be written in the src/test directory.</li><li><strong>End-to-End (UI) Tests: </strong>These tests simulate real user interactions with the app’s UI. They are used to verify that the entire app works as expected from the user’s perspective. UI tests are written in the src/androidTest directory, as they require Android components and need to run on an actual device or emulator.</li></ul><p>Now, let&#39;s create a class for which we will write tests. The class in question is a <strong>PaymentInputValidator </strong>that uses whitelist parameters to test inputs to prevent SQL injection and other security vulnerabilities.</p><pre>class PaymentInputValidator {<br><br>    // Whitelist of allowed characters<br>    private val allowedCharacters = (&#39;a&#39;..&#39;z&#39;) + (&#39;A&#39;..&#39;Z&#39;) + (&#39;0&#39;..&#39;9&#39;)<br><br>    /**<br>     * Validates if the input contains only allowed characters (a-z, A-Z, 0-9).<br>     * @param input The input string to validate.<br>     * @return true if the input is valid, false otherwise.<br>     */<br>    fun isInputValid(input: String): Boolean {<br>        for (char in input) {<br>            if (char !in allowedCharacters) {<br>                return false<br>            }<br>        }<br>        return true<br>    }<br><br>    /**<br>     * Checks if the input is empty or blank.<br>     * @param input The input string to validate.<br>     * @return true if the input is empty or blank, false otherwise.<br>     */<br>    fun isEmpty(input: String): Boolean {<br>        return input.isBlank()<br>    }<br>}</pre><p>Now, let’s test each function individually to ensure they work as expected. To do this, we’ll follow the <strong>AAA (Arrange-Act-Assert) pattern</strong>, a structured approach to writing effective tests:</p><ul><li><strong>Arrange:</strong> Set up the necessary conditions for the test. For example, create an instance of PaymentInputValidator and define the input string to validate (e.g., &quot;JohnDoe123&quot;).</li><li><strong>Act:</strong> Call the method you want to test. For instance, invoking isInputValid(&quot;JohnDoe123&quot;) to check if the input contains only allowed characters.</li><li><strong>Assert:</strong> Verify the result by comparing the method’s output with the expected value. If isInputValid(&quot;JohnDoe123&quot;) is expected to return true, we check that it does.</li></ul><p>Here is what the test code would look like</p><pre>class PaymentInputValidatorTest {<br><br>    private lateinit var validator: PaymentInputValidator<br><br>    @BeforeEach<br>    fun setUp() {<br>        validator = PaymentInputValidator()<br>    }<br><br>    @Test<br>    fun valid_input_should_return_true() {<br>        // Arrange<br>        val validInput = &quot;JohnDoe123&quot;<br><br>        // Act<br>        val result = validator.isInputValid(validInput)<br><br>        // Assert<br>        assertThat(result).isTrue<br>    }<br>}</pre><p>Now we couldn&#39;t write the test for all possible outcomes because of time but the goal here is to test as many outcomes as possible</p><p><strong>Run Your Test</strong>: You can run your tests from Android Studio by right-clicking on the test class or using the command line.</p><h3>Understanding JUnit Annotations</h3><p>In unit testing with JUnit, various annotations help you manage the test lifecycle and organize your tests. Here’s a quick overview of some essential annotations:</p><ul><li><strong>@Before</strong>: The <strong>Before</strong>annotation ensures that setup initialization runs before each test method. This prevents redundant code and ensures a fresh instance for every test.</li></ul><pre>@Before<br>fun setUp() {<br>    validator = PaymentInputValidator()<br>}</pre><ul><li><strong>@After : </strong>is used to clean up resources after each test execution. This ensures the value held in any test is properly cleaned up.</li></ul><pre>@After<br>fun tearDown() {<br>    // Clean up resources if needed<br>}</pre><ul><li><strong>@BeforeClass </strong>: This annotation marks a method that should run once before any tests in the class are executed. It&#39;s useful for setup that you want to do only once.</li></ul><pre>@BeforeClass<br>fun init() {<br>    // Run once before any tests in this class<br>}</pre><ul><li><strong>@AfterClass</strong>: This annotation marks a method that will run once after all tests in the class have finished. It’s useful for final cleanup.</li></ul><pre>@AfterClass<br>fun cleanup() {<br>    // Run once after all tests in this class<br>}</pre><ul><li><strong>@Test</strong>: This annotation marks a method as a test method. JUnit runs any method annotated with @Test.</li></ul><pre>@Test<br>    fun valid_input_should_return_true() {<br>        // Arrange<br>        val validInput = &quot;JohnDoe123&quot;<br><br>        // Act<br>        val result = validator.isInputValid(validInput)<br><br>        // Assert<br>        assertThat(result).isTrue<br>    }</pre><p>By using these annotations, you can effectively organize your test code, and ensure that your tests run as expected.</p><h3>Conclusion:</h3><p>Unit testing is a continuous process. Once you have written a unit test you can add more test cases to cover different scenarios and edge cases. for example, if you write more tests you would notice our code has problems with spaces in the input.</p><p>Remember, unit testing is just one part of a comprehensive testing strategy. in our next article, we will dive into other different testing techniques to achieve thorough test coverage and build a reliable mobile application.</p><p>Thank you for reading. 🙌🙏✌.</p><blockquote><em>Found this helpful? Don’t forgot to clap 👏 and follow me for more such useful articles about Android development and Kotlin.</em></blockquote><p>If you need any help related to Android, Kotlin. I’m always happy to help you.</p><p>Follow me on: <a href="https://www.linkedin.com/in/emmanueldav/"><strong>LinkedIn</strong></a>, <a href="https://github.com/EmmanuelDav"><strong>Github</strong></a>, <a href="https://emmanueldav.medium.com/"><strong>Medium</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf24640bed45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prevent Man-in-the-Middle Attacks in Your Android App: SSL and TLS Pinning the Right Way]]></title>
            <link>https://emmanueldav.medium.com/prevent-man-in-the-middle-attacks-in-your-android-app-ssl-and-tls-pinning-the-right-way-2bec53977672?source=rss-b035fbc2b13c------2</link>
            <guid isPermaLink="false">https://medium.com/p/2bec53977672</guid>
            <category><![CDATA[ssl-certificate]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[ssl-pinning]]></category>
            <category><![CDATA[android-security]]></category>
            <category><![CDATA[retrofit]]></category>
            <dc:creator><![CDATA[Iyke Emmanuel]]></dc:creator>
            <pubDate>Mon, 10 Feb 2025 22:34:07 GMT</pubDate>
            <atom:updated>2025-02-10T22:34:07.771Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6vclWJ4ac2DT1RT9LgDUnQ.jpeg" /></figure><h3>Introduction</h3><p><strong>Secure Sockets Layer (SSL)</strong> and <strong>Transport Layer Security (TLS)</strong> pinning are critical security measures that help protect mobile applications from various threats, such as <strong>man-in-the-middle (MITM)</strong> attacks and data tampering. By implementing <strong>SSL/TLS pinning</strong>, you ensure that your Android app communicates only with trusted servers, reducing the risk of malicious entities intercepting or manipulating network traffic.</p><p>In this article, we’ll break down <strong>SSL pinning</strong>, why it’s essential, and how to implement it in an Android app using <strong>OkHttp</strong>, one of the most popular HTTP client libraries. By the end, you’ll have a solid understanding of how to fortify your app’s network security against potential threats. Let’s dive in!</p><h4><strong>What is SSL Pinning</strong></h4><p>Think of <strong>SSL/TLS pinning</strong> as hiring a VIP-only bouncer for your party. Normally, a regular bouncer checks IDs and trusts whatever information is provided (just like how <strong>Certificate Authorities (CAs)</strong> validate SSL/TLS certificates). But with <strong>SSL pinning</strong>, your bouncer doesn’t just check IDs — they have an exclusive guest list and only allow entry to pre-approved individuals.</p><p>In technical terms, instead of trusting any certificate that a CA signs, <strong>SSL pinning</strong> hardcodes a trusted server’s <strong>public key</strong> or <strong>certificate</strong> directly in your app. This ensures your app connects only to the intended servers, blocking potential imposters and making <strong>man-in-the-middle attacks</strong> nearly impossible.</p><h4><strong>Types of SSL Pinning</strong></h4><p>When implementing <strong>SSL pinning</strong> in an Android app, you have two main approaches: <strong>Public Key Pinning</strong> and <strong>Certificate Pinning</strong>. While both serve the same purpose, they differ in how they validate the server’s identity.</p><p><strong>Public Key Pinning:<br></strong>Public key pinning<strong> </strong>is slightly more complex to implement because it requires obtaining the server’s certificate and extracting the <strong>public key</strong> from it. Unlike <strong>certificate pinning</strong>, where the entire certificate must match exactly, <strong>public key pinning</strong> focuses only on the key inside the certificate.</p><p>This means that if a server rotates its certificate but retains the same <strong>public key</strong>, the connection will still be trusted.</p><p><strong>Certificate Pinning:<br></strong>Certificate pinning is one of the simplest methods to implement and is highly secure. You simply fetch the server’s certificate and bundle it within your app. When the app makes a request, it compares the server’s certificate with the one stored locally. If they match, the connection proceeds; if not, it is blocked.</p><p>However, a major drawback of <strong>certificate pinning</strong> is that certificates have expiration dates and can change at any time. Many articles suggest that you need to manually update the app for a new certificate to work but not anymore, this is 2025, <strong>We don’t do that here</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F16558003&amp;display_name=Tenor&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Fwe-dont-do-that-here-black-panther-tchalla-bruce-gif-16558003&amp;image=https%3A%2F%2Fmedia.tenor.com%2FfBvQV_5Lp6UAAAAN%2Fwe-dont-do-that-here-black-panther.png&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/847347f3915dc46bd166068c20830fc4/href">https://medium.com/media/847347f3915dc46bd166068c20830fc4/href</a></iframe><p>rather In this tutorial, I will show you a way to automatically get your certificate pinning in Android without frequently updating your app.</p><h4>Step-by-Step Guide to SSL Pinning in OkHttp on Android</h4><h4>Step 1: Obtain the Server Certificate</h4><p>To get the certificate key there are two ways to do it</p><p><strong>First through terminal Using OpenSSL (Command Line)</strong></p><ul><li>Run the following command:</li></ul><pre>echo | openssl s_client -connect yourservername.com:443 -servername yourservername.com -showcerts</pre><ul><li>Replace yourservername.com with your target domain.</li></ul><p>The output will include the server certificate in<strong> PEM format</strong>, which looks like this:</p><pre>- - -BEGIN CERTIFICATE - - -<br>(Base64 Encoded Certificate)<br> - - -END CERTIFICATE - - -</pre><ul><li>Copy and save the certificate as server.crt.</li></ul><p><strong>OR Using a Web Browser</strong></p><ul><li>Open <strong>Google Chrome</strong> (or any browser).</li><li>Visit the website (https://yourservername.com).</li><li>Click the <strong>lock icon</strong> in the address bar and select <strong>Certificate (Valid)</strong>.</li><li>Go to the <strong>Details</strong> tab and click <strong>Export</strong> to save the certificate as <strong>Base64-encoded ASCII, single certificate</strong>.</li></ul><h4>Step 2: Convert the Certificate to Base64</h4><p>Convert the certificate to a format that can be embedded into your app:</p><pre>openssl x509 -in server.crt -outform DER | base64</pre><p>Save the <strong>Base64 string</strong> to a secure server (e.g., Firebase); you’ll need it later.</p><h4>Step 3: Implementation with OkHttp and Retrofit</h4><p>First, add the OkHttp dependency to your build.gradle file:</p><pre>implementation &#39;com.squareup.okhttp3:okhttp:4.9.0&#39;<br>implementation &#39;com.squareup.okhttp3:okhttp-tls:4.9.0&#39; // Required for SSL pinning</pre><h4>Step 4: Fetch the Base64 String dynamically ie firebase</h4><pre>fun fetchDynamicCertificate(): ByteArray {<br>    // Simulated fetched Base64 string from Firebase (replace this with your actual fetched value)<br>    val base64Cert = &quot;MII...&quot; // Your Base64 certificate string here (without BEGIN/END)<br><br>    // Convert Base64 string to DER format (ByteArray)<br>    return Base64.decode(base64Cert, Base64.DEFAULT)<br>}</pre><h4>Step 5: Create a Custom Trust Manager for SSL Pinning</h4><p>You need to set up a TrustManager that will pin the dynamically fetched certificate or public key.</p><p>Here’s how you can create a custom TrustManager in OkHttp:</p><pre>fun createPinnedOkHttpClient(): OkHttpClient {<br>    // Load the certificate from a dynamically fetched source<br>    val certificateBytes = fetchDynamicCertificate()<br><br>    // Convert the byte array into an X.509 certificate<br>    val certificateFactory = CertificateFactory.getInstance(&quot;X.509&quot;)<br>    val certificate = certificateFactory.generateCertificate(certificateBytes.inputStream()) as X509Certificate<br><br>    // Create an in-memory KeyStore and add the certificate<br>    val keyStore = KeyStore.getInstance(KeyStore.getDefaultType()).apply {<br>        load(null, null)<br>        setCertificateEntry(&quot;pinned_certificate&quot;, certificate)<br>    }<br><br>    // Initialize a TrustManager using the KeyStore<br>    val trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()).apply {<br>        init(keyStore)<br>    }<br>    val trustManagers = trustManagerFactory.trustManagers<br><br>    // Ensure we get a proper X509TrustManager instance<br>    val trustManager = trustManagers.firstOrNull { it is X509TrustManager } as? X509TrustManager<br>        ?: throw IllegalStateException(&quot;No X509TrustManager found&quot;)<br><br>    // Configure SSLContext with the custom TrustManager<br>    val sslContext = SSLContext.getInstance(&quot;TLS&quot;).apply {<br>        init(null, arrayOf&lt;TrustManager&gt;(trustManager), SecureRandom())<br>    }<br><br>    // Build OkHttpClient with the pinned certificate<br>    return OkHttpClient.Builder()<br>        .sslSocketFactory(sslContext.socketFactory, trustManager)<br>        .build()<br>}</pre><h4>Step 6: Make a Request Using the Custom OkHttpClient:</h4><p>Now that the OkHttpClient is set up with SSL pinning, you can use it to make network requests:</p><pre>fun makeSecureRequest() {<br>    val client = createPinnedOkHttpClient()<br>    val request = Request.Builder()<br>        .url(https://medium.com/&quot;https://your-secure-server.com/api&quot;)  // Replace with your server URL<br>        .build()<br>    client.newCall(request).enqueue(object : Callback {<br>        override fun onFailure(call: Call, e: IOException) {<br>            // Handle failure<br>            e.printStackTrace()<br>        }<br>        override fun onResponse(call: Call, response: Response) {<br>            // Handle the response<br>            println(&quot;Response: ${response.body?.string()}&quot;)<br>        }<br>    })<br>}</pre><h4>Summary</h4><p>In today’s digital landscape, <strong>SSL/TLS pinning</strong> is a crucial measure for protecting Android applications from <strong>man-in-the-middle (MITM)</strong> attacks. Whether you’re developing a banking app, a healthcare platform, or any app handling sensitive user data, implementing <strong>SSL/TLS pinning</strong> fortifies your app against unauthorized interceptions and enhances user trust.</p><h4>Best Practices for SSL Pinning:</h4><ol><li><strong>Public Key Pinning:</strong> Instead of pinning entire certificates, pinning public keys reduces the need for frequent updates.</li><li><strong>Dynamic Certificate Updates:</strong> Fetching certificates securely from a trusted server enables seamless key rotation and prevents outdated pins from breaking your app.</li><li><strong>Security Enhancements:</strong> Use obfuscation tools like <strong>R8</strong> or <strong>ProGuard</strong> and conduct regular security testing to ensure your implementation stays resilient against reverse engineering and attacks.</li><li><strong>Handling Certificate Expiry:</strong> Implement a fallback mechanism to ensure smooth certificate renewal without requiring an app update.</li></ol><p>Using <strong>OkHttp</strong> and a custom <strong>TrustManager</strong>, you can dynamically fetch and validate certificates at runtime, adding an extra layer of flexibility and security to your network communication.</p><p>If you found this article helpful, don’t forget to <strong>like</strong>, <strong>share</strong>, and <strong>clap</strong> 👏! Let’s connect on <a href="https://www.linkedin.com/in/emmanueldav/"><strong>LinkedIn</strong> </a>and <a href="https://github.com/EmmanuelDav"><strong>GitHub</strong> </a>to grow together as Android developers. 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2bec53977672" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Fatal Coroutine Mistakes Nobody Talks About in Android]]></title>
            <link>https://emmanueldav.medium.com/5-fatal-coroutine-mistakes-nobody-talks-about-in-android-5e8932f91228?source=rss-b035fbc2b13c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e8932f91228</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[koltin]]></category>
            <category><![CDATA[kotlin-coroutines]]></category>
            <dc:creator><![CDATA[Iyke Emmanuel]]></dc:creator>
            <pubDate>Wed, 05 Feb 2025 10:59:06 GMT</pubDate>
            <atom:updated>2025-02-05T11:25:04.620Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gkBXSkGUbP0y_OYMH2BjtQ.jpeg" /></figure><h3><strong>Introduction:</strong></h3><p>As Android developers, Kotlin Coroutines have become an essential part of our daily workflow. They make asynchronous programming and concurrency handling feel effortless — almost too effortless. But that simplicity can be deceptive. Many developers unknowingly fall into subtle yet <strong>dangerous pitfalls</strong> that, at first glance, seem like best practices.</p><p>Today, we’re pulling back the curtain to <strong>x-ray these hidden mistakes</strong>, explore their real-world consequences, and uncover <strong>better, more efficient alternatives</strong>. Buckle up — this might just save your next project from unexpected crashes, memory leaks, and performance nightmares!</p><h3>1: Calling suspend Function Directly in Views</h3><p>Calling a suspend function directly inside a ViewModel may seem harmless, but it can lead to <strong>serious lifecycle issues</strong> and <strong>main thread blocking problems</strong> if not handled properly. This is especially common in <strong>MVP (Model-View-Presenter) architecture</strong>, where developers try to fetch data and update UI state directly from a suspend function inside ViewModel.</p><h4>Why is This a Problem?</h4><ul><li><strong>Blocking the Main Thread</strong>: If a suspend function performs a long-running operation (e.g., network call) without switching to a background thread (e.g., Dispatchers.IO), it can block the main thread, causing lag or ANRs (Application Not Responding errors).</li><li><strong>Lifecycle Issues</strong>: ViewModels survive configuration changes, but if coroutines are not properly scoped (e.g., using viewModelScope), they might continue executing even after the UI is destroyed, leading to memory leaks or wasted resources.</li><li><strong>Lost Network Results</strong>: If the coroutine is tied to a ViewModel that gets cleared (e.g., when the activity/fragment is finished), the result might never reach the UI, as the coroutine will be canceled.</li></ul><h4>Example of the Wrong Approach</h4><pre>class MyViewModel(private val repository: MyRepository) : ViewModel() {<br><br>   suspend fun fetchUserData() {<br>        val user = repository.getUser() ❌ <br>    }<br>}</pre><h4>What’s Wrong Here?</h4><ul><li>The fetchUserData function is marked as suspend, but it doesn’t handle threading or lifecycle properly. It also doesn’t expose the result to the UI, making it useless for updating the UI state.</li></ul><h4>Correct Approach:</h4><pre>class MyViewModel(private val repository: MyRepository) : ViewModel() {<br><br>    private val _user = MutableLiveData&lt;User&gt;()<br>    val user: LiveData&lt;User&gt; get() = _user<br><br>    fun fetchUserData() {<br>        viewModelScope.launch {<br>            try {<br>                val result = repository.getUser() // ✅ Safe coroutine call<br>                _user.postValue(result)  // ✅ Updates UI on the Main thread<br>            } catch (e: Exception) {<br>                // Handle error properly<br>            }<br>        }<br>    }<br>}</pre><p>The fetchUserData function uses viewModelScope.launch to safely execute the coroutine within the ViewModel&#39;s lifecycle. The result is exposed to the UI using LiveData, ensuring that the UI is updated on the main thread.</p><h3>2) Incorrect use of Global scope</h3><p>Coroutines are a powerful tool in Kotlin, but misusing GlobalScope can cause major issues like memory leaks, unmanageable background tasks, and crashes. Many developers unknowingly use it incorrectly, leading to problems that are hard to debug, especially in Android development where lifecycle awareness is crucial.&quot;</p><h4>Why is this a problem</h4><p>using GlobalScope.launch in an Android application is problematic because:</p><ul><li><strong>It Cannot Be Canceled </strong>— Once started, a coroutine in GlobalScope runs independently of the app&#39;s lifecycle. If the user leaves the screen, the coroutine keeps running in the background, potentially wasting resources.</li><li><strong>It Ignores Lifecycle Awareness</strong> — Unlike viewModelScope, GlobalScope doesn’t cancel coroutines when the ViewModel is cleared. This means data updates might be attempted on a destroyed UI, causing crashes and unexpected behaviors.</li><li><strong>No Custom Dispatcher or Exception Handling</strong> — GlobalScope.launch always defaults to Dispatchers.Default, which may not be optimal for network requests (which should run on Dispatchers.IO). Additionally, unhandled exceptions in GlobalScope can crash the entire app, as there is no structured concurrency to handle them properly<strong>.</strong></li></ul><h4>Example of Wrong approach</h4><pre>GloablScope.launch{<br>  delay(400)<br>  Log.d(&quot;Global scope&quot;, &quot;Task Successful&quot;)<br>}</pre><h4>How to Fix It</h4><p>To ensure proper lifecycle management, <strong>always use </strong><strong>viewModelScope.launch instead of </strong><strong>GlobalScope.launch</strong>.</p><pre>viewmodelscope.launch{<br>  delay(400)<br>  Log.d(&quot;viewmodel&quot;, &quot;Task Successful&quot;)<br>}</pre><h3><strong>3) Fetching Data Sequentially Instead of Asynchronously</strong></h3><p>I still feel a bit frustrated about this mistake because I made it during my interview with Fairmoney, and it ended up costing me the job offer. One of the common pitfalls developers face with Kotlin coroutines is executing network calls sequentially when they could be run in parallel. This can lead to significantly longer execution times, causing unnecessary delays and affecting the user experience.</p><p>Why is This a Problem?</p><p>Fetching data <strong>sequentially</strong> (one after the other) is inefficient, especially when:</p><ul><li><strong>Each request is independent</strong> — If fetching function A doesn’t depend on fetchingfunction B, running them sequentially is wasteful and increases the total execution time unnecessarily.</li><li><strong>Network calls are time-consuming</strong> – Running multiple 1-second calls one after the other <strong>scales linearly</strong> (5 calls = 5 seconds!).</li><li><strong>User experience suffers</strong> – The app hangs longer than necessary, leading to frustration.</li></ul><h4>Example of the wrong approach</h4><pre>suspend fun mistakeGetCarNames(ids: List&lt;Int&gt;): List&lt;String&gt; {<br>    val names = mutableListOf&lt;String&gt;()<br>    for (id in ids) {<br>        names.add(getCarNameById(id)) ❌ // Wrong: Calls run one after another, wasting time!<br>    }<br>    return names<br>}</pre><h4>What’s Wrong Here?</h4><ul><li><strong>Each network call must finish before the next one starts.</strong></li><li><strong>Time wasted</strong> — If each request takes 1s and there are 5 requests, total time = 5s.</li><li><strong>Unnecessary delays</strong> – The app becomes sluggish, blocking the UI longer than needed.</li></ul><h4>How to fix it</h4><p>We can <strong>fetch all data concurrently</strong> using async {} inside coroutineScope {}.</p><p>Optimized Code Using async-awaitAll (Good Code)</p><pre>suspend fun getCarNames(ids: List&lt;Int&gt;): List&lt;String&gt; {<br>    return coroutineScope { <br>        ids.map { id -&gt; <br>            async { getCarNameById(id) } // ✅ Runs all requests in parallel!<br>        }.awaitAll() // ✅ Waits for all coroutines to complete and returns results<br>    }<br>}</pre><ul><li><strong>Runs all network calls concurrently</strong> — Instead of running them one by one, async allows them to start at the same time.</li><li><strong>Reduces total execution time</strong> – If each call takes 1s and there are 5 calls, total time ≈ 1s instead of 5s.</li><li><strong>Better user experience</strong> – Faster responses mean the app feels more responsive.</li></ul><h3>4) Catching CancellationException in Suspend Functions:</h3><p>One of the biggest coroutine mistakes in Android development is catching CancellationException without properly rethrowing it back to the parent. This leads to unexpected behavior, where canceled coroutines continue running when they should stop immediately, potentially causing memory leaks and wasted resources.</p><p><strong>Why is this a problem</strong></p><p>When a coroutine is canceled (e.g., due to a lifecycle event like Activity destruction), it throws a <strong>CancellationException</strong>.</p><ul><li>If you catch this exception and do not rethrow it, the parent coroutine won’t know it was canceled!</li><li>This can cause memory leaks, UI lag, and unnecessary background processing.</li></ul><h4>Example of the wrong approach</h4><pre>suspend fun mistakeRiskyTask() {<br>    try {<br>        delay(3_000L) // Simulating long-running operation<br>        val error = 10 / 0  // ❌ This will throw an ArithmeticException<br>    } catch (e: Exception) {<br>        println(&quot;iyke: code failed&quot;) ❌ // Catching all exceptions, including CancellationException!<br>    }<br>}</pre><h4>What’s Wrong Here?</h4><ul><li><strong>Catches </strong><strong>CancellationException along with other exceptions</strong> – If the coroutine was canceled, the parent coroutine won’t know.</li><li><strong>Coroutine continues running after being canceled</strong> – This can lead to wasted CPU cycles and memory leaks.</li><li><strong>Unexpected behavior</strong> – The app might <strong>appear unresponsive or laggy</strong> because coroutines aren’t stopping when they should.</li></ul><h4>How to fix it</h4><pre>suspend fun riskyTask() {<br>    try {<br>        delay(3_000L) // Simulating long-running operation<br>        val error = 10 / 0  // ❌ This will throw an ArithmeticException<br>    } catch (e: Exception) {<br>        if (e is CancellationException) throw e // ✅ Rethrow CancellationException!<br>        println(&quot;Emmanuel iyke: code not working&quot;) // ✅ Handle other exceptions properly<br>    }<br>}</pre><ul><li><strong>Always rethrow </strong><strong>CancellationException inside a </strong><strong>catch block</strong> so the parent coroutine is aware of it.</li><li><strong>Only handle other exceptions (e.g., </strong><strong>IOException, </strong><strong>ArithmeticException) separately</strong></li></ul><h3>5) Checking for coroutine cancellation</h3><p>One common mistake when using coroutines in Kotlin is <strong>not checking if the coroutine is still active</strong> while executing long-running tasks</p><p>Why is This a Problem?</p><ul><li>If a coroutine is canceled but <strong>your loop keeps running</strong>, the coroutine <strong>never actually stops</strong>, leading to:</li><li><strong>Wasted CPU resources</strong> — The loop continues executing, consuming unnecessary processing power.</li><li><strong>Memory leaks</strong> — The coroutine remains in memory even when it’s no longer needed.</li><li><strong>UI lag or app crashes</strong> — If the coroutine is working on UI updates, this could cause unexpected UI behavior.</li></ul><h4>Example of the wrong approach</h4><pre>suspend fun mistakeDoSomething() {<br>    val job = CoroutineScope(Dispatchers.Default).launch {<br>        var random = Random.nextInt(100_000)<br>        while (random != 50_000) {  // ❌ No check for cancellation<br>            println(&quot;Random: $random&quot;)<br>            random = Random.nextInt(100_000)<br>        }<br>    }<br>    println(&quot;Random: our job cancelled&quot;)<br>    delay(500L)<br>    job.cancel() // ❌ This won&#39;t immediately stop the loop<br>}</pre><h4>What&#39;s wrong here</h4><ul><li><strong>Job is canceled, but the loop doesn’t stop immediately</strong> — The while loop keeps running because it doesn’t check if the coroutine is still active.</li><li><strong>Leads to unnecessary CPU usage</strong> – The loop runs until it reaches 50_000, even though we canceled the job.</li><li><strong>Unreliable behavior</strong> – You expect it to stop when canceled, but it keeps running until completion.</li></ul><h4>How to fix it</h4><pre>suspend fun doSomethingWithIsActive() {<br>    val job = CoroutineScope(Dispatchers.Default).launch {<br>        var random = Random.nextInt(100_000)<br>        while (isActive &amp;&amp; random != 50_000) { // ✅ Manually check if coroutine is active<br>            println(&quot;Random: $random&quot;)<br>            random = Random.nextInt(100_000)<br>        }<br>    }<br>    println(&quot;Random: our job cancelled&quot;)<br>    delay(500L)<br>    job.cancel() // ✅ Coroutine will now stop properly<br>}</pre><ul><li>Instead of isActive, you can use ensureActive(), which is a built-in property of coroutines.</li><li>Use <strong>isActive</strong> inside loops – It throws a CancellationException if the coroutine is canceled, stopping it immediately.</li></ul><h3>Conclusion</h3><p>Kotlin Coroutines are powerful tools for building <strong>scalable, responsive, and efficient</strong> Android applications. By understanding and avoiding common pitfalls — such as improper scope usage, unhandled exceptions, and ignoring coroutine cancellation — you can write more <strong>efficient, reliable, and maintainable</strong> asynchronous code.</p><p>🔹 Always choose the correct dispatcher.<br>🔹 Tie your coroutines to the appropriate lifecycle.<br>🔹 Handle exceptions thoughtfully.<br>🔹 Prioritize structured concurrency and lifecycle awareness.<br>🔹 Test your coroutine code thoroughly.</p><p>By following these best practices, you’ll harness the full potential of Kotlin Coroutines, ensuring <strong>robust app performance</strong> and a <strong>smooth user experience</strong>.</p><p>🙌 <strong>Thank You for Reading!</strong><br>If you have questions or need help with Android or Kotlin, feel free to reach out. Let’s connect and grow together! 🚀</p><p>🔗 <strong>Follow me on:</strong></p><ul><li><a href="https://www.linkedin.com/in/emmanueldav/"><strong>LinkedIn</strong></a></li><li><a href="https://github.com/EmmanuelDav"><strong>GitHub</strong></a></li></ul><p>👏 <strong>Don’t forget to clap and follow for more articles on Android Development, Kotlin, Jetpack Compose, and best practices!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e8932f91228" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Diverse Types of Classes in Kotlin and when to use them]]></title>
            <link>https://emmanueldav.medium.com/diverse-types-of-classes-in-kotlin-and-when-to-use-them-517d6bfe4114?source=rss-b035fbc2b13c------2</link>
            <guid isPermaLink="false">https://medium.com/p/517d6bfe4114</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin-beginners]]></category>
            <dc:creator><![CDATA[Iyke Emmanuel]]></dc:creator>
            <pubDate>Sun, 01 Sep 2024 23:03:50 GMT</pubDate>
            <atom:updated>2024-09-01T23:03:50.813Z</atom:updated>
            <content:encoded><![CDATA[<p>Becoming a Pro Kotlin developer requires you to understand different types of classes in Kotlin and when to use them, This helps significantly in writing more efficient, clean, and maintainable code that is more robust and prone to error. In this article, I will share my experience with the different types of classes Kotlin has to offer and the different scenarios to use them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BqY1oJICQ1pKPPzWUOF8ig.png" /></figure><h4><strong>What are classes?</strong></h4><p>I know it sounds cheesy to ask but understanding what classes really are makes way to understand the different types there are. I know you have seen this definition before “<em>A class is a blueprint for creating objects</em>” So just as blueprints in architecture can lead to different types of buildings like houses, skyscrapers, or bridges — depending on the design, a class in Kotlin can also take on different forms depending on what it’s meant to do.</p><p><strong>Why Different types of classes?</strong></p><p>Now, not all classes are created equal. Some are meant to just hold data, others to enforce certain behaviors, and some to provide a single, global instance. That’s why Kotlin offers different types of classes, each tailored to specific needs. Just like you wouldn’t use the same blueprint for a skyscraper and a small cottage, you shouldn’t use the same type of class for all your coding needs.</p><p>Each type of class in Kotlin is designed to serve a particular purpose, allowing you to write cleaner, more efficient code. Let’s explore these different types and see when and why you’d want to use them.</p><h3>Sealed class</h3><p>A sealed class is a class that restricts its inheritance to a specific set of subclasses. In other words, it allows you to define a restricted set of subclasses right inside the sealed class itself, and no other subclasses can be created outside of this definition. This makes sealed classes perfect for situations where you know all the possible options in advance, like handling different states of a network request (e.g., Success, Error, Loading). By using a sealed class, you ensure that every possible case is covered, which makes your code more reliable and easier to manage.</p><p>Example:</p><pre>sealed class NetworkResult&lt;out T&gt; {<br>    data class Success&lt;out T&gt;(val data: T) : NetworkResult&lt;T&gt;()<br>    data class Error(val exception: Throwable) : NetworkResult&lt;Nothing&gt;()<br>    object Loading : NetworkResult&lt;Nothing&gt;()<br>}<br><br>fun handleResponse(result: NetworkResult&lt;String&gt;) {<br>    when (result) {<br>        is NetworkResult.Success -&gt; println(&quot;Data: ${result.data}&quot;)<br>        is NetworkResult.Error -&gt; println(&quot;Error: ${result.exception.message}&quot;)<br>        NetworkResult.Loading -&gt; println(&quot;Loading...&quot;)<br>    }<br>}<br><br>fun main() {<br>    val result = NetworkResult.Success(&quot;Kotlin is awesome&quot;)<br>    handleResponse(result)<br>}</pre><p>Sealed classes are useful in situations where you have a fixed set of possible classes that need to be represented such as</p><ul><li><strong>Representing Success and Failure States</strong>: Common in network operations or database queries, Just like in the example above where you might have a NetworkResult type representing success, error, or loading states.</li><li><strong>Defining State Machines</strong>: Useful for modeling state transitions in complex systems.</li><li><strong>Type-safe Event Handling</strong>: Ensuring all possible events are handled in user interfaces or reactive systems.</li></ul><h3>Data Class</h3><p>A data class in Kotlin is a concise and efficient way to create classes <strong>that are primarily used to hold data</strong>. Kotlin makes it easier to work with immutable data objects by automatically generating several useful functions for data classes.</p><p>When you declare a data class, Kotlin automatically generates functions like equals(), hashCode(), toString(), and copy(). The copy() function is particularly helpful for creating a new instance with some properties changed, while keeping the original data intact. The data keyword also provides functions that allow destructuring declarations, which means you can break down an object into its component properties easily. For example, if you have a data class User(val name: String, val age: Int), you can destructure it like val (name, age) = user.</p><p>Example:</p><pre>data class User(<br>    val id: Int,<br>    val name: String,<br>    val email: String<br>)<br><br>fun main() {<br>    // Creating an instance of the User data class<br>    val user1 = User(1, &quot;cyber iyke&quot;, &quot;cyber.@example.com&quot;)<br><br>    // Using the copy() function to create a new instance with a modified name<br>    val user2 = user1.copy(name = &quot;James&quot;)<br><br>    // Printing the original and copied instances<br>    println(user1)  <br>    println(user2) <br><br>    // Destructuring the User object into individual variables<br>    val (id, name, email) = user1<br>    println(&quot;ID: $id, Name: $name, Email: $email&quot;)<br>}</pre><p>Kotlin’s data classes are designed for scenarios where the primary purpose of the class is to hold data. Here are the key situations where using a data class is ideal</p><ul><li><strong>Library Integration: </strong>Use data classes when working with libraries like kotlinx.serialization for JSON serialization or Parcelize for Android’s Parcelable implementation. Data classes integrate smoothly with these tools, making your code more efficient.</li><li><strong>Auto-Generated Methods:</strong> Opt for a data class when you need easy comparison, debugging, or cloning of objects. With automatically generated methods like equals(), hashCode(), toString(), copy(), and componentN(), data classes make these tasks straightforward.</li><li><strong>Concise Syntax for Data Handling: </strong>Use a data class when you want to reduce boilerplate code. If your class is mainly meant to store data and doesn’t require complex logic, a data class provides a clear and concise way to define it.</li></ul><h3>Abstract Class</h3><p>An abstract class in Kotlin serves as a blueprint or template for other classes. It cannot be instantiated on its own, meaning you can’t create an object directly from it. Instead, it’s designed to be extended by other subclasses, which then build upon its structure.</p><p>Abstract classes are ideal when you want to enforce common behavior across multiple related classes, ensuring that certain methods or properties are shared and implemented consistently.</p><p><strong>Example:</strong></p><pre>// Abstract class representing a generic person<br>abstract class Person {<br>    abstract var height: Int<br>    abstract var age: Int<br>    abstract fun speak()<br>}<br><br>// Subclass representing a specific person<br>class Student(override var height: Int, override var age: Int) : Person() {<br>    override fun speak() {<br>        println(&quot;I&#39;m a student, and I love learning!&quot;)<br>    }<br>}<br><br>fun main() {<br>    val student = Student(170, 20)<br>    student.speak()  // Output: I&#39;m a student, and I love learning!<br>}</pre><p>Abstract classes in Kotlin are exceedingly beneficial in architecture and software development, especially when dealing with large-scale apps with intricate class hierarchies. They yield a standard template for classes that share common functionalities, promoting clean and DRY (Don’t Repeat Yourself) code. Below are perfect scenarios abstract classes are required:</p><ul><li><strong>Designing Functional Units:</strong> When creating large, functional units in your application, abstract classes help define a common structure that can be extended and customized by subclasses.</li><li><strong>Building Toolkits and Frameworks:</strong> If you’re developing toolkits or frameworks where end-users need to extend your base classes, abstract classes offer a flexible foundation for them to build upon.</li><li><strong>Enforcing Common Behavior:</strong> When you need to provide a common mechanism across multiple subclasses while allowing for some flexibility in implementation, abstract classes are ideal.</li></ul><h3>Interfaces:</h3><p>An interface in Kotlin is a <strong>contract</strong> that a class can implement, defining a set of abstract methods that the implementing class must provide. An abstract class and an interface in Kotlin both allow you to define methods that other classes must implement, but they serve different purposes and have key distinctions.</p><p>An abstract class can hold state, meaning it can have properties with actual values, and it can also provide both fully implemented methods and abstract methods that subclasses must override. In contrast, an interface cannot hold state and can only declare properties that must either be abstract or provide accessor implementations. While a class can only inherit from one abstract class, it can implement multiple interfaces, which makes interfaces a better choice for defining shared behavior across unrelated class hierarchies. Additionally, interface members are ‘open’ by default, allowing multiple inheritance of behavior, whereas abstract classes are more suited for scenarios where you need to provide a base class with common functionality and state management that can be shared among its subclasses.</p><p><strong>Example</strong>:</p><pre>interface ViewModelContract&lt;T&gt; {<br>    val data: T?<br>    val isLoading: Boolean<br><br>    fun fetchData()<br>    fun clearData()<br>}<br><br>class UserViewModel : ViewModelContract&lt;User&gt; {<br>    override var data: User? = null<br>    override var isLoading: Boolean = false<br><br>    override fun fetchData() {<br>        isLoading = true<br>        // Simulate a network request or database operation<br>        data = User(&quot;John&quot;, &quot;cyber.doe@example.com&quot;)<br>        isLoading = false<br>    }<br><br>    override fun clearData() {<br>        data = null<br>    }<br>}</pre><p>Abstract classes and interfaces both play crucial roles in Kotlin’s object-oriented design. Abstract classes are used when you want to share state and behavior across a set of related classes, while interfaces are used to define a contract that any class can implement, regardless of where it fits in the class hierarchy. Understanding these differences allows you to use them effectively to design flexible and maintainable code.</p><h3>Enum class:</h3><p>Enum classes are your go-to when you need a set of related constants that won’t change. They are used to represent fixed choices or categories. For example, if you’re dealing with something like gender, days of the week, or cardinal directions, an enum class allows you to define all the possible options in one place.</p><p><strong>Example</strong></p><pre>enum class DayOfWeek {<br>    MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY<br>}<br><br>fun isWeekend(day: DayOfWeek): Boolean {<br>    return day == DayOfWeek.SATURDAY || day == DayOfWeek.SUNDAY<br>}<br><br>fun main() {<br>    val today = DayOfWeek.FRIDAY<br>    println(&quot;Is today a weekend? ${isWeekend(today)}&quot;)<br>    // Output: Is today a weekend? false<br>}</pre><p>When to use Enum Class:</p><ul><li><strong>Fixed Set of Values</strong>: Use an enum class when you have a clearly defined set of related constants that won’t change over time. For example, days of the week (Monday, Tuesday, etc.), directions (North, South, etc.), or user roles (Admin, User, Guest).</li><li><strong>Type Safety</strong>: If you want to ensure that a variable can only take on one of a predefined set of values, an enum class is the right choice. This reduces the risk of invalid values being assigned and makes your code more robust</li></ul><h3>Inner class</h3><p>An inner class in Kotlin is a class that is defined inside another class using the inner keyword. By using the inner keyword, the inner class gains a special relationship with its outer class, allowing it to access all of the outer class’s properties and methods, including private ones.</p><p>An inner class is useful in situations where inner class needs to interact with or rely on the outer class’s instance. This is particularly helpful in scenarios where the inner class needs to use or manipulate the outer class’s data or behavior, creating a tightly-coupled relationship.</p><p><strong>Example</strong></p><pre>class ClassRoom(val name: String) {<br><br>    private val outerPrivateProperty: String = &quot;This is a private property&quot;<br><br>    // Inner class declaration<br>    inner class Student(val age: Int) {<br>        <br>        fun displayInfo() {<br>            println(&quot;ClassRoom name: $name&quot;)<br>            println(&quot;Students age: $age&quot;)<br>        }<br>    }<br>}</pre><h3>Nested class</h3><p>A nested class in Kotlin is a class defined within another class, but without the inner keyword. This means that the nested class is completely independent of its outer class. It does not have access to the members of the outer class unless they are explicitly passed to it.</p><p>Nested classes are useful when you need to logically group classes together to keep your code organized. They are especially helpful when the nested class is only relevant in the context of the outer class but doesn’t need access to its members. This helps in encapsulating the nested class within the outer class, indicating that the nested class is related to the outer class, but without establishing a strong relationship.</p><pre>class Cookie {<br>    val type = &quot;Chocolate Chip&quot;<br><br>    class ChocolateChip {<br>        fun getAmount(): String {<br>            return &quot;lots of&quot;  // Everyone loves lots of chocolate chips!<br>        }<br>    }<br><br>    fun describe() {<br>        val chips = ChocolateChip()<br>        println(&quot;This is a $type cookie with ${chips.getAmount()} chips!&quot;)<br>    }<br>}</pre><h3>Summary</h3><p>Understanding Kotlin classes is key to becoming proficient in the language. From data classes that make handling data simple and efficient to abstract and sealed classes that help structure your code, each type of class serves a unique purpose. Enum classes provide clarity when dealing with fixed sets of constants, while nested and inner classes allow for more complex relationships within your code. Mastering these concepts will help you write cleaner, more maintainable, and effective Kotlin code, making you a Super developer.</p><p>Thank you for reading till the end! For more insightful articles, follow me on Medium and <a href="https://www.linkedin.com/in/emmanueldav/">Linkedin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=517d6bfe4114" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automate Dependency Updates With GitHub Action]]></title>
            <link>https://blog.stackademic.com/automate-dependency-updates-with-github-action-3c7bda1113f5?source=rss-b035fbc2b13c------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c7bda1113f5</guid>
            <category><![CDATA[gradle]]></category>
            <category><![CDATA[gradle-plugin]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Iyke Emmanuel]]></dc:creator>
            <pubDate>Wed, 15 Nov 2023 12:26:57 GMT</pubDate>
            <atom:updated>2023-11-20T01:23:54.227Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*5NhpSTFG_ceflyYG.png" /></figure><p>Modern Android projects usually include a lot of Gradle dependencies, keeping up to date with them however can be a huge tedious task for the developer, that is precious time spent that can be used in completing other tasks</p><p>In this article, we are going to talk about how to automatically upgrade our dependency and generate pull Request to our main branch. We will be using the <a href="https://github.com/littlerobots/version-catalog-update-plugin"><strong>Version Catalog Update Plugin</strong></a><strong> </strong>to declare the dependencies and <a href="https://github.com/features/actions"><strong>GitHub Actions</strong></a><strong> </strong>to build, test, and generate pull Request to our main branch</p><h3>How Gradle Version Catalog works</h3><p>Gradle Version Catalog is a powerful tool for dependency management, It provides a centralized way to declare and control the versions of external dependencies used in your project. With the Gradle Version Catalog, you can define a catalog file that lists the versions of your dependencies, plugins, and other artifacts.</p><blockquote>Gradle version catalogs works by enabling you to add and maintain dependencies and plugins in a scalable way. So instead of hardcoding dependency names and versions in individual build files we define them in the catalog and use them in all of your modules.</blockquote><h4>Benefits of using Gradle Version Catalogs</h4><ul><li><strong>Centralization</strong>: With a single source of truth for dependency versions, it becomes easier to ensure consistency across projects.</li><li><strong>Simplified Updates:</strong> When a new version of a library is released, you can update it in the catalog, and all projects referencing that catalog will receive the update.</li><li><strong>Version Conflict Resolution: </strong>The catalog helps to avoid version conflicts by enforcing the specified versions throughout your projects.</li><li><strong>Ease of Collaboration:</strong> By sharing the catalog across teams, you foster collaboration and maintain a unified standard across your organization.</li></ul><h3>How to use Gradle Version Catalogs on Android</h3><h4>Step 1: Create a version catalog file</h4><p>The first step is to create alibs.versions.toml file in the root of your gradle folder, it&#39;s important to name it libs.versions.toml because Gradle looks for the catalog name by default</p><h4>Step 2: Install the plugins</h4><p>the next step is to install the plugins, we do that by adding the code below to our build.gradle:</p><pre>plugins {<br>  id &quot;com.github.ben-manes.versions&quot; version &quot;0.41.0&quot;<br>  id &quot;nl.littlerobots.version-catalog-update&quot; version &quot;&lt;latest version&gt;&quot;<br>}</pre><p>Once the plugins are installed, to update the catalog file, you can execute the command ./gradlew versionCatalogUpdate at any time. This command handles the following tasks</p><h4>Step 3: Implement the dependencies</h4><p>Define the versions for your dependencies in libs.versions.toml and Specify the dependencies using the declared versions:</p><pre>[versions]<br>exoplayer = &quot;2.19.1&quot;<br>androidx = &quot;1.9.0&quot;<br>core = &quot;3.5.1&quot;<br><br>[libraries]<br>exoplayer = { module = &quot;com.google.android.exoplayer:exoplayer&quot;, version.ref = &quot;exoplayer&quot; }<br>androidx = { module = &quot;androidx.core:core-ktx&quot;, version.ref = &quot;androidx&quot; }<br>core = { module = &quot;androidx.test.espresso:espresso-core&quot;, version.ref = &quot;core&quot; }</pre><ul><li>The Versions declare the versions used in other sections.</li><li>The library declares the dependencies used in the versions</li></ul><p>Now all you need is to implement the dependencies by referencing the library file inside build.gradle</p><pre>    implementation (libs.rxjava)<br>    implementation(libs.exoplayer)<br>    androidTestImplementation(libs.core)</pre><h4>Step 4: Create a .yml file for your GitHub action</h4><p>Now to automate the process using Github action we need to create a .yml. Within your project folder, establish the path github/workflows/dependency_update.yml and insert the following code:</p><pre>name: Update Dependencies<br><br>on:<br>  workflow_dispatch:<br>  schedule:<br>    - cron: &#39;00 6 1 * *&#39;<br><br>jobs:<br>  update-dependencies:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - uses: actions/checkout@v3<br>      - uses: actions/setup-java@v1<br>        with:<br>          java-version: 17<br>      - name: Grant execute permission for gradlew<br>        run: chmod +x gradlew<br>      - name: Perform dependencies resolution and update<br>        run: ./gradlew versionCatalogUpdate<br>      - name: Build and Test<br>        run: ./gradlew clean build test<br>      - name: Create Pull Request<br>        uses: peter-evans/create-pull-request@v4<br>        with:<br>          token: ${{ secrets.GITHUB_TOKEN}}<br>          commit-message: update dependencies<br>          committer: GitHub &lt;noreply@github.com&gt;<br>          author: GitHub &lt;noreply@github.com&gt;<br>          title: Update dependencies<br>          body: |<br>            Dependencies update.<br>            Check the Version Catalog to see which dependencies need an update.<br>          branch: update-dependencies<br>          delete-branch: true<br>          labels: |<br>            dependencies update</pre><p>This YAML configuration establishes a GitHub Actions workflow, “Update Dependencies,” triggered manually or scheduled for 6:00 AM on the first day monthly. The workflow, within the update-dependencies job, executes key steps like checking out the repository, setting up Java, granting execute permission for gradlew, updating dependencies, and creating a pull request with commit details and a descriptive body. This workflow streamlines dependency management in your project, providing automation for essential tasks. Adjust the YAML code as per your project&#39;s needs.</p><h3>Conclusion:</h3><p>Gradle version catalogs are a powerful tool for managing the versions of your dependencies in Android development. By using a version catalog, you can ensure that all developers on a project are using the same version of a particular dependency, and you can easily update the version in one place across all your projects.</p><p>I hope this blog has helped you understand what Gradle version catalogs are and how to use them in Android development.</p><p>Stay tuned! Happy reading 📚 Happy coding 💻</p><p><em>If you have any queries related to Android, I’m always happy to help you. You can reach me on </em><a href="https://twitter.com/EmmanuelDav_K"><strong><em>Twitter</em></strong></a><strong><em> </em></strong><em>and </em><a href="https://www.linkedin.com/in/emmanueldav/"><strong><em>LinkedIn</em></strong></a><strong><em>.</em></strong></p><h3>Stackademic</h3><p><em>Thank you for reading until the end. Before you go:</em></p><ul><li><em>Please consider </em><strong><em>clapping</em></strong><em> and </em><strong><em>following</em></strong><em> the writer! 👏</em></li><li><em>Follow us on </em><a href="https://twitter.com/stackademichq"><strong><em>Twitter(X)</em></strong></a><em>, </em><a href="https://www.linkedin.com/company/stackademic"><strong><em>LinkedIn</em></strong></a><em>, and </em><a href="https://www.youtube.com/c/stackademic"><strong><em>YouTube</em></strong></a><strong><em>.</em></strong></li><li><em>Visit </em><a href="http://stackademic.com/"><strong><em>Stackademic.com</em></strong></a><em> to find out more about how we are democratizing free programming education around the world.</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c7bda1113f5" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/automate-dependency-updates-with-github-action-3c7bda1113f5">Automate Dependency Updates With GitHub Action</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>