<?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 Utkarsh Saxena on Medium]]></title>
        <description><![CDATA[Stories by Utkarsh Saxena on Medium]]></description>
        <link>https://medium.com/@utkarsh06?source=rss-d7d89fcb50d3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*I2QiSCaniJMSeNhMp5DTkQ.jpeg</url>
            <title>Stories by Utkarsh Saxena on Medium</title>
            <link>https://medium.com/@utkarsh06?source=rss-d7d89fcb50d3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 04:43:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@utkarsh06/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[Migrating a Production Android App to Android 16 (API 36): A Practical Migration Guide]]></title>
            <link>https://medium.com/@utkarsh06/migrating-a-production-android-app-to-android-16-api-36-089ea5ae7c59?source=rss-d7d89fcb50d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/089ea5ae7c59</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-16]]></category>
            <dc:creator><![CDATA[Utkarsh Saxena]]></dc:creator>
            <pubDate>Sat, 25 Jul 2026 09:20:26 GMT</pubDate>
            <atom:updated>2026-07-25T09:49:27.283Z</atom:updated>
            <content:encoded><![CDATA[<p>Every year, Google updates its Android platform with new APIs, security improvements, privacy enhancements, and behavioural changes. To keep the Android ecosystem healthy, Google also updates its Play Store requirements, requiring apps to target a recent Android API level.</p><p>From <strong>31 August 2026</strong>, all app updates submitted to Google Play must target <strong>Android 16 (API 36)</strong> or later. While existing users can continue using older versions of an app, developers won’t be able to publish updates until the application complies with the new target SDK requirement.</p><p>At first glance, migrating from API 35 to API 36 looks like changing a single number in build.gradle.</p><p>In reality, that’s only the beginning.</p><p>We recently completed this migration for a production Android application, and the majority of the work wasn’t writing new code…it was auditing years of accumulated dependencies, validating platform behaviour changes, identifying hidden compatibility issues, and ensuring the application behaved exactly the same after opting into Android 16.</p><p>This article walks through the migration process we followed and the lessons we learnt along the way.</p><h3>Understanding compileSdk vs targetSdk</h3><p>One of the most common misconceptions during Android migrations is assuming that compileSdk and targetSdk serve the same purpose.</p><p>They don’t.</p><p><strong>compileSdk</strong> determines which Android SDK your application is compiled against. Increasing it allows your project to use the latest Android APIs and reveals compilation issues such as deprecated methods, removed APIs, or incompatible libraries.</p><p><strong>targetSdk</strong>, however, is far more significant. Increasing the target SDK tells Android that your application is ready to adopt the behavioural changes introduced in that platform version. These changes can affect notifications, permissions, background execution, foreground services, storage, navigation, and many other system interactions.</p><p>For this reason, we deliberately treated these as two separate phases. We first upgraded compileSdk to ensure the project compiled cleanly. Only after resolving build issues did we increase targetSdk, allowing us to focus exclusively on runtime behaviour changes.</p><p>That separation made debugging significantly easier.</p><h3>Phase 1: Auditing the Project</h3><p>Before modifying a single configuration value, we wanted to understand the current health of the project.</p><p>The first step was reviewing our build environment, including:</p><ul><li>Android Gradle Plugin (AGP)</li><li>Gradle Wrapper</li><li>Kotlin version</li><li>JDK version</li><li>compileSdk</li><li>targetSdk</li><li>minSdk</li></ul><p>We also audited every dependency used across the application to identify libraries that were outdated, deprecated, or lacked Android 16 support.</p><p>Rather than jumping directly into implementation, we documented the migration approach in a Technical Requirement Document (TRD), listing expected risks, affected modules, testing strategy, and rollback considerations. Having this document aligned the engineering and QA teams before development began.</p><h3>Phase 2: Upgrading compileSdk to API 36</h3><p>Instead of immediately targeting Android 16, we first updated only the compileSdk.</p><p>This allowed us to identify compilation issues without enabling Android 16 runtime behaviour.</p><p>After rebuilding the project, we encountered several expected issues, including deprecated APIs, outdated imports, lint warnings, and dependency incompatibilities. Resolving these at an early stage meant later debugging could focus purely on runtime changes rather than build failures.</p><p>Once every module compiled successfully and CI pipelines were green, we moved to the next phase with confidence.</p><h3>Phase 3: Dependency Audit and Library Compatibility</h3><p>Platform migrations are rarely blocked by application code alone.</p><p>The real challenge often lies in third-party libraries.</p><p>We generated the complete dependency graph and reviewed every major library used throughout the application, including AndroidX, Compose, Firebase, Media3, WorkManager, Hilt, Retrofit, and several internal SDKs.</p><p>Rather than upgrading everything to the latest available version, we prioritised stable releases with official Android 16 support or important bug fixes. This minimised regression risk while ensuring long-term compatibility.</p><p>By the end of this phase, the project wasn’t just compiling against Android 16, it was backed by libraries that officially supported it.</p><h3>Phase 4: Upgrading targetSdk to API 36</h3><p>Increasing the target SDK is where the migration truly begins.</p><p>Unlike compileSdk, this immediately opts the application into Android 16&#39;s runtime behaviour changes.</p><p>To avoid surprises, we used Android Studio’s <strong>SDK Upgrade Assistant</strong> to review every documented change before modifying the target SDK. Each warning was mapped to the relevant area of our codebase so that we could verify whether it actually affected our implementation.</p><p>Only after understanding those changes did we update the targetSdk and begin validating the application behaviour.</p><h3>Phase 5: Reviewing Android 16 Behaviour Changes</h3><p><a href="https://developer.android.com/about/versions/16/summary">https://developer.android.com/about/versions/16/summary</a></p><p>Before writing any migration code, we spent time reading the official Android 16 behaviour changes documentation.</p><p>Rather than assuming every change affected us, we created a checklist of the platform features our application actually used.</p><p>This included:</p><ul><li>Notifications, Runtime permissions, Background execution</li><li>Foreground services, Storage, WebView</li><li>Edge-to-edge layouts, Navigation, System interactions</li></ul><p>For every documented behaviour change, we searched the codebase to determine whether action was required. Many changes turned out to be irrelevant, while a few required careful implementation updates.</p><p>This simple exercise prevented unnecessary work and kept the migration focused.</p><h3>Phase 6: Proactive Codebase Audit</h3><p>One lesson we’ve learnt from previous Android migrations is that waiting for QA to discover issues is expensive.</p><p>Instead, we performed a proactive code audit using targeted global searches.</p><p>Rather than searching feature by feature, we searched for Android APIs that frequently change across platform releases, including:</p><ul><li>PendingIntent, NotificationManager, AlarmManager, BroadcastReceiver</li><li>WorkManager</li><li>FileProvider</li><li>WebView</li><li>Runtime permissions</li></ul><p>This approach uncovered issues that had existed long before Android 16.</p><p>One example was several PendingIntent implementations that were missing FLAG_IMMUTABLE. Although unrelated to Android 16 itself, these code paths could crash on Android 12+ if executed.</p><p>Finding these issues during migration significantly reduced surprises during QA.</p><h3>Phase 7: AndroidManifest Audit</h3><p>The Android Manifest often becomes a source of compatibility issues after multiple years of development.</p><p>We reviewed every component declaration, including activities, services, broadcast receivers, and content providers.</p><p>Particular attention was given to:</p><ul><li>android:exported</li><li>foregroundServiceType</li><li>Obsolete permissions</li><li>Deprecated manifest attributes</li><li>New platform requirements</li></ul><p>During navigation validation, we also temporarily disabled Predictive Back using:</p><pre>android:enableOnBackInvokedCallback=&quot;false&quot;</pre><p>This allowed the application to maintain stable navigation while we verified all back-stack scenarios before adopting the newer navigation behaviour.</p><h3>Phase 8: Runtime Permissions Audit</h3><p>Android’s permission model continues to evolve with every release, making permission reviews an essential part of any platform migration.</p><p>We audited every runtime permission requested by the application to ensure it was still required and behaved correctly on Android 16. We verified permission request flows, denial handling, and feature degradation when permissions were unavailable.</p><p>Removing unnecessary permissions not only simplifies maintenance but also improves user trust and reduces Play Store review complexity.</p><h3>Phase 9: Background Execution and Foreground Services</h3><p>Background execution has become increasingly restricted over recent Android releases.</p><p>To ensure reliability, we reviewed every background task in the application, including WorkManager jobs, foreground services, AlarmManager scheduling, background broadcasts, and long-running operations.</p><p>Each implementation was validated against Android’s latest guidance to confirm that the correct API was being used for its purpose.</p><p>By auditing background execution early, we avoided unexpected failures caused by newer system restrictions.</p><h3>Phase 10: Notifications and PendingIntent Review</h3><p>Notifications are one of the most sensitive areas affected by target SDK upgrades.</p><p>We reviewed notification channels, foreground notifications, notification actions, deep links, and every PendingIntent created throughout the application.</p><p>During this review we discovered several older implementations that lacked FLAG_IMMUTABLE.</p><p>Although this issue predated the Android 16 migration, upgrading the target SDK provided an opportunity to eliminate these hidden crash risks before they reached production.</p><p>The result was a notification system that behaved consistently across all supported Android versions.</p><h3>Phase 11: Storage and File Access</h3><p>Storage APIs have changed significantly over the past few Android releases.</p><p>We reviewed every location where the application interacted with files, shared content, downloaded media, or communicated with external applications.</p><p>Special attention was given to scoped storage, FileProvider, URI permissions, and temporary file sharing to ensure they aligned with modern Android security practices.</p><p>Fortunately, only minor updates were required, but validating these flows prevented potential runtime failures on newer devices.</p><h3>Phase 12: UI, Edge-to-Edge and Navigation Validation</h3><p>A successful migration isn’t complete until the user experience has been validated.</p><p>We manually reviewed the application across multiple devices, screen sizes, and Android versions to verify:</p><ul><li>Edge-to-edge layouts</li><li>Status bar and navigation bar insets</li><li>Keyboard behaviour</li><li>Dialog positioning</li><li>Fragment navigation</li><li>Predictive Back compatibility</li></ul><p>While Android 16 encourages Predictive Back, we postponed enabling it until every navigation flow had been fully tested. Taking an incremental approach reduced migration risk without delaying the platform upgrade.</p><h3>Phase 13: Regression Testing</h3><p>The final, and arguably most important phase was testing.</p><p>Platform migrations impact every feature of an application, so relying solely on developer testing isn’t enough.</p><p>Our testing strategy included:</p><ul><li>Developer sanity testing</li><li>QA regression testing</li><li>Cross-version testing on Android 14, 15, and 16</li><li>Physical devices alongside emulators</li><li>Team-wide bug bash sessions</li><li>Smoke testing before release</li></ul><p>Several small issues surfaced during regression, but because earlier phases had already eliminated most compatibility problems, QA was able to focus on functional validation rather than discovering platform-breaking bugs.</p><h3>Key Takeaways</h3><p>Migrating to Android 16 wasn’t about changing one Gradle property, it was about understanding how years of application code interact with a modern Android platform.</p><p>Some of the most valuable lessons from this migration were:</p><ul><li>Treat compileSdk and targetSdk upgrades as separate phases.</li><li>Audit dependencies before changing the target SDK.</li><li>Read the official behaviour changes instead of relying on trial and error.</li><li>Perform proactive codebase searches for commonly affected Android APIs.</li><li>Use the migration as an opportunity to eliminate legacy technical debt.</li><li>Invest heavily in regression testing before rolling out to production.</li></ul><h3>Final Thoughts</h3><p>Looking back, increasing the SDK version took only a few minutes. The real effort was understanding platform behaviour, validating existing functionality, and ensuring users experienced a seamless upgrade.</p><p>Android platform migrations shouldn’t be viewed as annual compliance work. They are opportunities to modernise the codebase, remove legacy issues, improve stability, and prepare the application for future Android releases.</p><p>If your team is planning an Android 16 migration, start early, audit thoroughly, and treat the migration as a structured engineering project rather than a last-minute checklist. The extra preparation pays for itself many times over when release week arrives.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=089ea5ae7c59" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Fixed the “Permission denied (publickey)” Error While Cloning a Bitbucket Repository]]></title>
            <link>https://medium.com/@utkarsh06/how-i-fixed-the-permission-denied-publickey-error-while-cloning-a-bitbucket-repository-1751f779bd7a?source=rss-d7d89fcb50d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1751f779bd7a</guid>
            <category><![CDATA[onboarding]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[bitbucket]]></category>
            <dc:creator><![CDATA[Utkarsh Saxena]]></dc:creator>
            <pubDate>Fri, 26 Jun 2026 07:52:06 GMT</pubDate>
            <atom:updated>2026-06-26T07:52:06.699Z</atom:updated>
            <content:encoded><![CDATA[<h3>If you’re trying to clone a Bitbucket repository using SSH and see this error:</h3><pre>git@bitbucket.org: Permission denied (publickey).<br>fatal: Could not read from remote repository.</pre><p>don’t worry. It simply means Bitbucket couldn’t find an SSH key linked to your account.</p><p>Here’s how I fixed it.</p><h3>Step 1: Generate a New SSH Key</h3><p>Open Terminal and run:</p><pre>ssh-keygen -t ed25519 -C &quot;your-email@example.com&quot;</pre><p>Replace your-email@example.com with the email associated with your Bitbucket account.</p><p>When asked where to save the key, just press <strong>Enter</strong> to use the default location.</p><p>You can also leave the passphrase empty by pressing <strong>Enter</strong>, or set one for extra security.</p><h3>Step 2: Start the SSH Agent</h3><p>Run:</p><pre>eval &quot;$(ssh-agent -s)&quot;</pre><p>This starts the SSH agent, which manages your SSH keys.</p><h3>Step 3: Add the SSH Key</h3><p>Add your newly created key:</p><pre>ssh-add ~/.ssh/id_ed25519</pre><p>On newer versions of macOS, you can also use:</p><pre>ssh-add --apple-use-keychain ~/.ssh/id_ed25519</pre><h3>Step 4: Copy the Public Key</h3><p>Display your public key:</p><pre>cat ~/.ssh/id_ed25519.pub</pre><p>Copy the entire output — it starts with ssh-ed25519.</p><h3>Step 5: Add the Key to Bitbucket</h3><ol><li>Log in to Bitbucket.</li><li>Go to <strong>Personal Settings → SSH Keys</strong>.</li><li>Click <strong>Add Key</strong>.</li><li>Give it a name (for example, <em>My MacBook</em>).</li><li>Paste the copied public key and save it.</li></ol><h3>Step 6: Test the Connection</h3><p>Run:</p><pre>ssh -T git@bitbucket.org</pre><p>If everything is configured correctly, you’ll receive a message confirming that you’ve successfully authenticated.</p><h3>Step 7: Clone the Repository</h3><p>You’re now ready to clone your repository:</p><pre>git clone git@bitbucket.org:&lt;workspace&gt;/&lt;repository&gt;.git</pre><h3>Final Thoughts</h3><p>The Permission denied (publickey) error usually means your SSH key is either missing or hasn&#39;t been added to Bitbucket. Once you generate a key, add it to your account, and verify the connection, cloning repositories over SSH becomes seamless.</p><p>I hope this saves you the time I spent troubleshooting it. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1751f779bd7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to check your react native app for 16Kb page compliance?]]></title>
            <link>https://medium.com/@utkarsh06/how-to-check-your-react-native-app-for-16kb-page-compliance-f26c8b01e2e1?source=rss-d7d89fcb50d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f26c8b01e2e1</guid>
            <category><![CDATA[16-kb-page-size]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Utkarsh Saxena]]></dc:creator>
            <pubDate>Tue, 03 Mar 2026 09:07:11 GMT</pubDate>
            <atom:updated>2026-04-30T06:49:13.424Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>STEP 1</strong>: Confirm Android SDK is visible</p><p><strong>Run</strong>: echo $ANDROID_HOME</p><p><strong>Expected</strong>: /Users/your_system_name/Library/Android/sdk</p><p>If empty → add to ~/.zshrc:</p><pre>export ANDROID_HOME=$HOME/Library/Android/sdk<br>export ANDROID_SDK_ROOT=$ANDROID_HOME<br>export PATH=$PATH:$ANDROID_HOME/platform-tools</pre><p>Apply:</p><pre>source ~/.zshrc</pre><h3>Verify SDK tools exist</h3><pre>ls $ANDROID_HOME/platform-tools</pre><p>and we should see: adb, fastboot</p><p><strong>STEP 2: </strong>Ensure local.properties exists</p><p>in android/local.properties, add given below line:</p><pre>sdk.dir=/Users/your_system_name/Library/Android/sdk</pre><p><strong>STEP 3:</strong> Clean project</p><p>From project root:</p><pre>rm -rf node_modules<br>rm -rf android/.gradle<br>rm -rf android/build<br>rm -rf android/app/build<br><br>npm install</pre><p>Then:</p><pre>cd android<br>./gradlew clean<br>cd ..</pre><p><strong>STEP 4:</strong> Verify Gradle Works</p><pre>cd android<br>./gradlew tasks<br><br>/*<br>If you see a long list → environment fixed.<br><br>If not → stop and fix SDK.  */</pre><p><strong>STEP 5:</strong> Build RELEASE APK (not debug)</p><p>16KB checks <strong>require release build</strong>.</p><pre>cd android<br>./gradlew assembleRelease</pre><p>APK will be created at:</p><pre>android/app/build/outputs/apk/release/app-release.apk</pre><p><strong>STEP 6 :</strong> Extract Native Libraries</p><p>From project root:</p><pre>mkdir apk_check<br>unzip android/app/build/outputs/apk/release/app-release.apk -d apk_check</pre><p>Go inside: apk_check/lib/arm64-v8a/</p><p>You’ll see files with <strong><em>.so extension</em></strong> which decides 16KB compatibility.</p><p>If it says file exists, then re-run this command, and select A</p><pre>unzip app/build/outputs/apk/release/app-release.apk -d apk_check</pre><p><strong>STEP 7:</strong> Automatically scan ALL Libraries</p><pre>find apk_check/lib -name &quot;*.so&quot; -exec sh -c &#39;<br>echo &quot;\nChecking: $1&quot;<br>&#39;&quot;$ANDROID_HOME&quot;&#39;/ndk/*/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-readelf -l &quot;$1&quot; | grep LOAD<br>&#39; _ {} \;</pre><p>You’ll get output like:</p><pre>libhermes.so → Align 0x4000 <br>libanalytics.so → Align 0x1000 <br></pre><p>You can simply analyse the apk via android studio and will see that alignment section is empty which means that our app is 16kb compliant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xKvzCM-vKda-Fql4sdNJAg.png" /></figure><p>If you loved this article, feel free to leave a like and share this article. <br>Do follow me on <a href="https://www.instagram.com/wingineers02">Instagram</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f26c8b01e2e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What If I Could Rewrite Android’s Activity Lifecycle: Part2: The Solution‍♂️]]></title>
            <link>https://medium.com/@utkarsh06/what-if-i-could-rewrite-androids-activity-lifecycle-part2-the-solution-%EF%B8%8F-de0589db632a?source=rss-d7d89fcb50d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/de0589db632a</guid>
            <category><![CDATA[activity-lifecycle]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Utkarsh Saxena]]></dc:creator>
            <pubDate>Wed, 25 Feb 2026 12:24:16 GMT</pubDate>
            <atom:updated>2026-02-25T12:24:16.254Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>First thing:</strong> kill most of the callbacks. Replace them with a clear state machine.</p><pre>sealed class ScreenState {<br> object Created : ScreenState()<br> object Visible : ScreenState()<br> object Interactive : ScreenState()<br> object Background : ScreenState()<br> object Destroyed : ScreenState()<br>}</pre><p>Instead of seven different methods that we need to remember, we get one:</p><pre>override fun onStateChanged(from: ScreenState, to: ScreenState) {<br>    when (to) {<br>        is ScreenState.Interactive -&gt; startVideoPlayback()<br>        is ScreenState.Background -&gt; pauseVideoPlayback()<br>        // etc...<br>    }<br>}</pre><p><strong>Second thing</strong>: Tell Me WHY Things Are Happening. It means that every state transition should come with context.</p><pre>sealed class TransitionReason {<br>    object UserNavigatedAway : TransitionReason()<br>    object ConfigurationChanged : TransitionReason()<br>    object AppBackgrounded : TransitionReason()<br>    object LowMemory : TransitionReason()<br>}<br><br>override fun onStateChanged(<br>    from: ScreenState, <br>    to: ScreenState, <br>    reason: TransitionReason<br>) {<br>    if (to == ScreenState.Background &amp;&amp; <br>        reason == TransitionReason.ConfigurationChanged<br>       ) {<br>        // Don&#39;t cancel the network call, just hide the UI<br>        return<br>    }<br>    <br>    if (to == ScreenState.Background &amp;&amp; <br>        reason == TransitionReason.UserNavigatedAway<br>       ) {<br>        // Actually pause/cleanup<br>        cancelPendingOperations()<br>    }<br>}</pre><p>This would lead to separate UI Lifecycle from Logic Lifecycle.</p><pre>// UI Lifecycle - managed by the framework<br>UI States: Visible → Hidden → Destroyed<br><br>// Feature Lifecycle - managed by our app<br>Feature States: Active → Idle → Suspended</pre><p><strong>Third thing</strong>: Configuration Changes Should Be Diffs, Not Destruction.</p><pre>override fun onConfigurationChanged(diff: ConfigurationDiff) {<br>    when {<br>        diff.orientationChanged -&gt; adjustLayoutForOrientation()<br>        diff.localeChanged -&gt; reloadLocalizedStrings()<br>        diff.darkModeChanged -&gt; updateTheme()<br>    }<br>    // That&#39;s it. State stays alive.<br>}<br><br>// The framework would handle keeping everything alive by default. <br>// No ViewModel tricks. No save/restore headache.<br>// Just update what is actually changed.</pre><p><strong>Fourth thing:</strong> Make Destruction Explicit and Predictable.</p><p>Currently, the system can kill our Activity after onStop() without any warning. The app is just… gone. Hope we saved that state. But here, in my fantasy world, this would look something like this.</p><pre>override fun onAboutToBeDestroyed(reason: DestructionReason): SaveableState {<br>    // Guaranteed callback before destruction<br>    // Return what you want to persist<br>    return SaveableState(<br>        userInputs = currentFormData,<br>        scrollPosition = recyclerViewPosition,<br>        // etc....<br>    )<br>}</pre><p>So this was all about my dream world. Hope you guys liked my thoughts.</p><p>Of course, none of this is going to happen. The Activity lifecycle is part of Android’s backbone. Changing it would break every app ever written. I get it.</p><p>But we can learn from these pain points. Jetpack Compose is already moving toward some of these ideas,declarative UI, clearer state management, better lifecycle handling. Maybe in five years, Activities will be a legacy concern that only old-timers like me remember.</p><p>Until then, I’ll keep writing those lifecycle diagrams on whiteboards for new team members. Haha… I’ll keep debugging rotation bugs. I’ll keep explaining why the app “lost” user data after a screen rotation.</p><p>And I’ll keep dreaming about what could have been.</p><p>Regards,</p><p>Utkarsh Saxena</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de0589db632a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What If I Could Rewrite Android’s Activity Lifecycle: Part1: The Problem‍♂️]]></title>
            <link>https://medium.com/@utkarsh06/what-if-i-could-rewrite-androids-activity-lifecycle-part1-the-problem-%EF%B8%8F-e5a3fb53b4d0?source=rss-d7d89fcb50d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5a3fb53b4d0</guid>
            <category><![CDATA[activity-lifecycle]]></category>
            <category><![CDATA[android-system-design]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Utkarsh Saxena]]></dc:creator>
            <pubDate>Tue, 27 Jan 2026 21:00:54 GMT</pubDate>
            <atom:updated>2026-01-27T21:00:54.045Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey there, I am just a normal developer who love Android. I’ve shipped features to millions of users, mentored junior developers, and built things that I’m genuinely proud of.</p><p>But if there’s one thing that’s haunted me from day one to today, it’s the Activity lifecycle. Every time I talk with a junior engineer, we struggle with the same questions I had years ago. And honestly? I’m still not sure we have good answers.</p><p>So here’s what I’d do differently if I could wave a magic wand and redesign the whole thing. This isn’t a rant, it’s more like a thought experiment from someone who’s been in the trenches long enough to know where the pain points really are.</p><h3>The Problem Nobody Talks About at Android Conferences</h3><p>We’ve all seen the lifecycle diagram. That beautiful flowchart with onCreate, onStart, onResume, onPause, onStop, onDestroy, and all the arrows between them. It hangs in every Android developer’s mental model like a cursed family portrait. Lol.</p><p>The first time I saw it, I thought: “Okay, this makes sense. Just follow the callbacks.”</p><p>Six months later, I was debugging why our analytics were reporting users “leaving” the checkout screen when they were just rotating their phones.</p><p>A year later, I was explaining to a PM why we couldn’t “just save the state” when the system killed our app in the background.</p><p>Here’s what nobody tells you: the Activity lifecycle isn’t really designed for the way we actually build apps anymore. It was created in a different era, when Activities were more self-contained and apps were simpler. But now? We’ve got ViewModels, repositories, network calls, WebSockets, location tracking, and a dozen other things that don’t map cleanly to “onCreate/onDestroy.”</p><h3>The Callback Hell</h3><p>The current lifecycle is <strong>callback-driven</strong>. That means you’re always reacting to something the OS tells you happened. onCreate? Cool, set up your views. onPause? Uh, should I pause this video? Cancel this API call? Save this form data? Who knows!</p><p>The worst part is that you end up with logic scattered everywhere. Video playback logic in onPause and onResume. Network call management in onCreate and onDestroy. State restoration in onCreate but also maybe in onRestoreInstanceState if you’re being thorough. It’s like trying to read a story where every other page is in a different book. I hope I am sounding right to you isn’t it?</p><p>I’ve reviewed pull requests where a single feature has code in six different lifecycle methods. That’s not the developer’s fault, that’s the framework forcing this fragmentation.</p><h3>The “Why” Problem</h3><p>Can your code tell <strong>why</strong> onPause() was called at some screen?</p><p>Was it because:</p><ul><li>The user pressed the Home button?</li><li>The user rotated the screen?</li><li>A dialog popped up?</li><li>The app entered split-screen mode?</li><li>The system is preparing to kill the app due to low memory?</li></ul><p><strong>Trick question:</strong> it can’t. This is the core problem.</p><p>Your app knows <em>something</em> happened, but not <em>what</em> or <em>why</em>.<br>And when you don’t know the reason, you make bad decisions.</p><h3>The Takeaway</h3><p>A lifecycle callback that doesn’t explain <em>why</em> it was triggered is dangerous.</p><p>When different user actions collapse into the same callback:</p><ul><li>Apps become fragile</li><li>Cleanup logic becomes over-aggressive</li><li>Bugs appear only in real-world usage</li></ul><p>This isn’t a coding mistake.<br> It’s an <strong>architectural limitation</strong>.</p><h3>Configuration Changes: The Boss Fight</h3><p>If the Activity lifecycle were a video game, configuration changes would be the boss fight everyone loses the first time.</p><p>On paper, it sounds easy: “Just handle rotation.”</p><p>In reality, rotation means:</p><ul><li>The system <strong>destroys your entire Activity</strong></li><li>All UI state is gone unless you explicitly saved it</li><li>Network calls get <strong>canceled</strong> (or worse, leaked)</li><li>Your ViewModel survives, <strong>but only if you wired it correctly</strong></li><li>Dialogs disappear</li><li>Animations stop mid-way</li><li>Scroll position resets unless you remembered to save it</li></ul><p>And all of this happens because… The user <strong>turned their phone</strong>.</p><p>They didn’t navigate away. They didn’t close the app.<br> They didn’t leave your screen.</p><p>They rotated a physical object, and we respond by <strong>destroying everything and starting from scratch</strong>, like it’s 1947.</p><p>I hope I am making sense to you. And even if I am not, feel free to drop your opinions and thoughts. I am going for a coffee to find a solution to this problem.</p><p>Also, if you liked this article, feel free to leave a like/comment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5a3fb53b4d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Android Renders UI?]]></title>
            <link>https://medium.com/@utkarsh06/how-android-renders-ui-1003ab84c5f6?source=rss-d7d89fcb50d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1003ab84c5f6</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-system-design]]></category>
            <dc:creator><![CDATA[Utkarsh Saxena]]></dc:creator>
            <pubDate>Sat, 17 Jan 2026 19:41:38 GMT</pubDate>
            <atom:updated>2026-01-17T19:41:38.467Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve ever wondered <em>“How does my UI actually appear on the screen?”</em> this article is for you.</p><p>There’s no magic involved.<br> Android UI rendering is a <strong>strict, step-by-step system pipeline</strong>.<br> Once you understand it, performance issues, jank, and UI bugs start making sense.</p><p>Let’s break it down <strong>simply</strong>.</p><h3>The Truth: UI Does NOT Render Continuously</h3><p>Android does <strong>not</strong> redraw the screen all the time.</p><p>It redraws <strong>only when the system asks for a new frame</strong>.</p><p>That request comes from the display hardware.</p><h3>Step 1: VSYNC: The “Draw Now” Signal</h3><p>Most Android screens refresh <strong>60 times per second</strong>.</p><p>This means that every ~16 milliseconds,</p><ul><li>The display sends a signal saying: <em>“I’m ready for the next frame”</em></li></ul><p>This signal is called <strong>VSYNC</strong>.</p><p>❗ No VSYNC → No UI update<br> Even if the user taps the screen, Android <strong>waits for VSYNC</strong>.</p><h3>Step 2: Choreographer: The Frame Manager</h3><p>Android has a component called <strong>Choreographer</strong>.</p><p>Think of it as the <strong>traffic controller</strong> for UI frames.</p><p>When VSYNC arrives, Choreographer says:</p><blockquote><em>“Alright, time to build the next frame.”</em></blockquote><p>It schedules work in this order:</p><ol><li>Handle user input</li><li>Update animations</li><li>Measure UI</li><li>Layout UI</li><li>Draw UI</li></ol><p>All of this must finish <strong>before the next VSYNC</strong>.</p><h3>Step 3: Main Thread</h3><p>All UI work happens on the <strong>main thread</strong>.</p><p>This includes:</p><ul><li>Touch handling</li><li>Measure</li><li>Layout</li><li>Draw</li></ul><p>⚠️ If the main thread is blocked, UI freezes.</p><p>This is the prime reason due to majority of apps lag.</p><h3>Step 4: Measure : How Big Is Each View?</h3><p>Now Android asks each UI element:</p><blockquote><strong><em>“How much space do you need?”</em></strong></blockquote><p>Parents give constraints. Children respond with width and height.</p><p>At this stage:</p><ul><li>only the size is decided</li><li>Position is <strong>NOT decided</strong></li></ul><h3>Step 5: Layout: Where Does Each View Go?</h3><p>Next, Android decides:</p><blockquote><em>“Where exactly will this view sit on the screen?”</em></blockquote><p>Each view gets:</p><ul><li>X position, Y position like maths coordinates hehe.</li><li>and Final boundaries</li></ul><p><strong>Now every view knows its size and position.</strong></p><h3>Step 6: Draw Instructions, Not Pixels</h3><p>This is important.</p><p>During draw:</p><ul><li>Android does <strong>not</strong> paint pixels on the screen</li><li>It only records <strong>drawing instructions</strong></li></ul><p>Examples:</p><ul><li>Draw text here</li><li>Draw image there</li><li>Fill background with color</li></ul><p>These instructions are stored as a <strong>Display List</strong>.</p><p>No pixels yet.</p><h3>Step 7: CPU Hands Over to GPU</h3><p>Once instructions are ready:</p><ul><li>CPU sends them to the GPU</li><li>GPU converts them into actual pixels</li><li>Shapes, text, images are rasterized (the process of converting a vector-based image or object into a raster or bitmap format.)</li></ul><p>This is where <strong>hardware acceleration</strong> helps performance.</p><h3>Step 8: Buffering: Smoothness Secret</h3><p>Android uses:</p><ul><li>Double buffering or triple buffering</li></ul><p>While:</p><ul><li>One frame is shown on screen and another is being prepared</li><li>and a third may be rendered</li></ul><p>This prevents flicker and keeps animations smooth.</p><h3>Step 9: SurfaceFlinger : Final Composer</h3><p>Android uses a system compositor called <strong>SurfaceFlinger</strong>.</p><p>It combines:</p><ul><li>Your app’s frame, Status bar, Navigation bar and Other system surfaces</li></ul><p>The final combined image is sent to the display.</p><p>That’s what the user sees.</p><pre>VSYNC<br> ↓<br>Choreographer#doFrame<br> ↓<br>ViewRootImpl#doTraversal<br> ↓<br>performMeasure<br> ↓<br>View#measure → onMeasure<br> ↓<br>performLayout<br> ↓<br>View#layout → onLayout<br> ↓<br>performDraw<br> ↓<br>View#draw → onDraw<br> ↓<br>RenderThread → GPU<br> ↓<br>SurfaceFlinger → Screen</pre><blockquote><strong><em>If this article helped clarify how Android renders UI, feel free to share it with fellow developers who care about performance and system design.</em></strong></blockquote><p>ThankYou!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1003ab84c5f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GIT 3 Branching Strategy]]></title>
            <link>https://medium.com/@utkarsh06/git-3-branching-strategy-9e4c6a4a770d?source=rss-d7d89fcb50d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e4c6a4a770d</guid>
            <category><![CDATA[okcredit]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[branching-strategy]]></category>
            <dc:creator><![CDATA[Utkarsh Saxena]]></dc:creator>
            <pubDate>Sun, 09 Jul 2023 10:25:00 GMT</pubDate>
            <atom:updated>2023-07-09T10:25:00.803Z</atom:updated>
            <content:encoded><![CDATA[<p>Whenever a fresher joins a tech company, it is one of the crucial things for him to know about how branching strategies are implemented for the codebase. Different companies follow different strategies to manage their code versions but this is the most accepted and popular method.</p><p>Lets begin now 😎</p><p>Generally, repositories in big organizations have 3 branches : <strong>Develop, Release and Master. </strong>Let’s assume that the initial code version is V1.</p><p>In production, a build generated out of V1 code is running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*efETuxaEORF3is6usSlQDg.jpeg" /></figure><p>Engineers now build their features and raise their PRs on develop branch.</p><p><strong>How Release is done ?</strong></p><p><strong>Step 1 : Take the changes from Develop to Release.</strong></p><p>After PRs get merged, Develop changes to V2 and since we are making changes to Release, it also changes to V2. <strong>It means that</strong> all the changes present in Develop are now in Release.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AFkVEcJGhGoD2BIh2kRXqw.jpeg" /></figure><p><strong>Step 2 : Regression on Release Branch</strong></p><p>Regression means to run <strong>Functional test cases</strong> which can be 1000 in number. So, it&#39;s done on the Release branch.</p><p><strong>Step 3 : Push to Live</strong></p><p>Production code version now changes to V2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lMZfAEjf8FDNhb2FBMUHrQ.jpeg" /></figure><p><strong>Step 4 : Monitor Live</strong></p><p>Nothing must break on Live. It means that nothing in the product should crash after introducing new features by Engineers. If build is proper, move to next step.</p><p><strong>Step 5 : Backmerge</strong></p><p>Update both Develop and Master from the Release branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*We_bhMHwIhPQhoWXlrqnAA.jpeg" /></figure><p>You can notice that, on each branch and production, code version is V2 😍</p><h3><strong>Use of Master Branch 🤓</strong></h3><p>Let’s understand first what is <strong>hotfix</strong>? Fixing of the issue immediately which has occurred on live.</p><p>Let’s understand the use of the master branch in detail. Suppose, the initial version is V1 and PRs are merged by engineers which makes Develop version V2.</p><p>Now, you will do step 1 and start Regression (step 2) but <strong>now suppose</strong> you have to do a Hotfix. And since regression has too many test cases it generally takes 2 days. What now? 😟 <strong>How to fix this live issue immediately??</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UDWmdCZYMykV_dIHpKAb6w.jpeg" /></figure><p>No worries, because <strong>Master branch is equivalent to Production</strong>. So, you can fix changes, make master branch version from V1 to V1.1 and push to live.</p><p>Also, we have to <strong>take these changes (Master hotfix) to the Release</strong> else hotfix changes will not be reflected when current release version V2 is pushed to live.</p><p>We only have to generate a new build again and our <strong>regression is not impacted.</strong></p><p>Hope this Article helped you well ! Stay Safe, Stay Happy</p><p>Do connect with me on LinkedIn ❤️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e4c6a4a770d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What to do in the Final Year of College Life?]]></title>
            <link>https://medium.com/@utkarsh06/what-to-do-in-the-final-year-of-college-life-366914857c6e?source=rss-d7d89fcb50d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/366914857c6e</guid>
            <category><![CDATA[love-yourself]]></category>
            <category><![CDATA[final-year]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[btech]]></category>
            <dc:creator><![CDATA[Utkarsh Saxena]]></dc:creator>
            <pubDate>Sun, 26 Mar 2023 13:18:20 GMT</pubDate>
            <atom:updated>2025-01-14T08:30:28.023Z</atom:updated>
            <content:encoded><![CDATA[<p>Ahaan, here you come to the ultimate chapter of your college life. Sounds, a bit emotional isn’t it? Trust me, I am writing this article with a heavy heart with just 3 months remaining of my college life 🙂<br>You might be placed till now and some of you might be unplaced. If you are unplaced, never lose hope. I was unplaced for 8 months and finally grabbed an excellent offer with a fantastic work culture at OkCredit 😎</p><p>I left 5 offers that includes service bond because I was a person who decided not to settle for less since I give my best to DSA+ Android+Frontend during my college days.</p><p>“At the end, the movie ends with a good climax”. Remember that Life is not about demeaning or pulling down each other legs, if you <strong>try to uplift </strong>the life of at least one guy at your college, trust me you will feel that your college life was so fruitful.<br>Have some trips with your friends and enjoy a lot because these days won’t come again in your life ❤<br>Do the revisions of what you have learned (DSA, Dev or any other thing)till now and give contests. <br>Shift your focus to learning LLD and HLD since it’s a crucial part of an engineer’s life.<br>Make connections with the senior developers of companies on LinkedIn and try to learn from them. Just one hour from them can give you vast knowledge ☺<br>Perform well during your Internship and have a learning attitude.</p><p>At the end, I want to conclude my words by saying that, said to me by Arpan Kumar Chandel😁 (King) bhaiya :<br>“Logo pe dhyan kam, kaam pe zyada !”<br>Ignore your Haters like Badshah Sir, and show your colors like Raftaar by performing well in different things ⚡<br>With that say, Be happy in your life apart from all the situations and take care 🌸<br>Signing off…..<br>Utkarsh Saxena<br>GL BAJAJ GROUP OF INSTITUTIONS, MATHURA<br>BATCH : 2019–2023</p><p><a href="https://www.youtube.com/@wingineers">Link</a> to my Tech Channel 💖</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=366914857c6e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adapter in Android with Kotlin]]></title>
            <link>https://medium.com/@utkarsh06/adapter-in-android-with-kotlin-36f8c75687bd?source=rss-d7d89fcb50d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/36f8c75687bd</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Utkarsh Saxena]]></dc:creator>
            <pubDate>Mon, 27 Feb 2023 05:30:02 GMT</pubDate>
            <atom:updated>2023-02-27T05:30:02.430Z</atom:updated>
            <content:encoded><![CDATA[<p>What is Adapter ?😭</p><p>To fill data in a list or a grid we need to implement Adapter. Adapters act <strong>like a bridge </strong>between UI components and data sources. Here data source is the source from where we get the data and UI components are list or grid items in which we want to display that data.</p><p>Ex: Adapter of your phone connects your mobile to the electricity board in home ☺</p><p>Some commonly used adapters in Android that are used to fill the data in the UI components are :</p><ol><li>BaseAdapter — It is the parent adapter for all other adapters.</li><li>ArrayAdapter — It is used whenever we have a list of single items which is backed by an array.</li><li>Custom ArrayAdapter — It is used whenever we need to display a custom list.</li><li>SimpleAdapter — It is an easy adapter to map static data to views defined in your XML file.</li><li>Custom SimpleAdapter — It is used whenever we need to display a customized list and needed to access the child items of the list or grid.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36f8c75687bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Companion Object in Kotlin]]></title>
            <link>https://medium.com/@utkarsh06/companion-object-in-kotlin-74b5b09f0b01?source=rss-d7d89fcb50d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/74b5b09f0b01</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin-beginners]]></category>
            <dc:creator><![CDATA[Utkarsh Saxena]]></dc:creator>
            <pubDate>Tue, 14 Feb 2023 07:48:10 GMT</pubDate>
            <atom:updated>2023-02-14T07:48:10.785Z</atom:updated>
            <content:encoded><![CDATA[<p>Look at the following code once :</p><p>class TobeCalled<br>{<br> fun callMe() = println(“Hello”)<br>}</p><p>fun main(args: Array&lt;String&gt;)<br>{<br> val obj = TobeCalled()<br> obj.callMe()<br>}</p><p>I can access the callMe function by creating an object of the “TobeCalled” class but what if I want to call it directly?</p><p>It must be statically declared so that I can call it as : TobeCalled.callMe() but static keyword doesn’t work in Kotlin, hence now comes the concept of companion objects.</p><p>In Kotlin, if we want to write a function or any member of the class that can be called <strong>without having the instance </strong>of the class then we can write the same as a member of a companion object inside the class.</p><p>To create a companion object, we need to add the<strong> companion keyword</strong> in front of the object declaration.</p><p>class TobeCalled<br>{<br> companion object Test {<br> fun callMe() = println(“Hello”)<br> }<br><br>}</p><p>fun main(args: Array&lt;String&gt;)<br>{<br> TobeCalled.callMe()<br>}</p><p>I hope this concept is now clear 😎</p><p>Follow me here for more such articles :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74b5b09f0b01" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>