<?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 Yassine Beldi on Medium]]></title>
        <description><![CDATA[Stories by Yassine Beldi on Medium]]></description>
        <link>https://medium.com/@Y4583L?source=rss-21f8ad148566------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*E5bduRl_NpNaXunT.jpg</url>
            <title>Stories by Yassine Beldi on Medium</title>
            <link>https://medium.com/@Y4583L?source=rss-21f8ad148566------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 07:30:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Y4583L/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[Views Are Officially in Maintenance Mode, Gradle Gets a YAML Makeover, and AI Agents Actually…]]></title>
            <link>https://medium.com/@Y4583L/views-are-officially-in-maintenance-mode-gradle-gets-a-yaml-makeover-and-ai-agents-actually-7ac40c938c95?source=rss-21f8ad148566------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ac40c938c95</guid>
            <dc:creator><![CDATA[Yassine Beldi]]></dc:creator>
            <pubDate>Thu, 05 Nov 2026 10:59:22 GMT</pubDate>
            <atom:updated>2026-11-05T11:00:08.254Z</atom:updated>
            <content:encoded><![CDATA[<h3>Views Are Officially in Maintenance Mode, Gradle Gets a YAML Makeover, and AI Agents Actually Caught Cheating: Everything That Mattered at Android Dev Summit 2026</h3><p><em>A no-fluff developer’s guide to the biggest engineering announcements from Mountain View and London, and the Play Store deadlines you need on your radar before 2027.</em></p><p>If you didn’t catch all 64 sessions from <a href="https://developer.android.com/events/dev-summit"><em>Android Dev Summit 2026</em></a><em> (</em><a href="https://www.youtube.com/watch?v=8Lmv7LGgL4E"><em>Keynote Recording</em></a>) across Mountain View and London’s 6 Pancras Square campus on October 28–29, don’t worry, nobody has time to watch 35 hours of talks while shipping a release.</p><p>I went through the transcripts, session notes, and demos across all five tracks (<strong>Tools and performance</strong>, <strong>Intelligent Apps</strong>, <strong>Apps Foundation</strong>, <strong>Android XR</strong>, and the <strong>Community track</strong>) to pull out what actually matters for working Android engineers. No marketing buzzwords, no “synergistic paradigms” , just the APIs, architectural changes, and hard Google Play deadlines that are going to affect your codebase over the next year.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9YbNAuBIGCfsnIcv4XIalw.jpeg" /></figure><h3>1. The Big Milestone: Android Views Are Officially in Maintenance Mode</h3><p>We all knew this day was coming, but hearing it stated plainly on stage still feels like the end of an era: <strong>Android is officially Compose-first, and the legacy </strong><strong>View system is now in maintenance mode.</strong></p><p>If you’re still maintaining a massive hybrid View + Compose codebase and wondering if a full migration is worth the pain, watch Kirill Grouchnikov and Jon Boekenoogen&#39;s talk, <a href="https://developer.android.com/events/dev-summit/talks/migrating-two-decades-of-the-google-play-app-to-jetpack-compose">Migrating two decades of the Google Play app to Jetpack Compose</a> (<a href="https://www.youtube.com/watch?v=7h_kcpNGKnw">Video</a>). The Play Store app is nearly twenty years old and runs on billions of devices. Starting in 2020, the team spent six years incrementally moving <strong>97% of user impressions</strong> to Compose-only screens. Over the last 14 months alone, their major pages saw a <strong>30% drop in jank</strong>.</p><p>A few practical lessons from how the Play team pulled it off:</p><ul><li><strong>Don’t generate dynamic color schemes on the main thread at runtime.</strong> Using MaterialTheme overlays with the Material Color Utilities library lets you theme entirely in code without tearing down the Activity, but generating schemes at build time saves precious milliseconds on startup.</li><li><strong>Run data sources and UI transforms in parallel.</strong> Moving to unidirectional data flow eliminated entire classes of race conditions and shaved dozens of milliseconds off load times.</li><li><strong>Enforce rules with custom Lint checks.</strong> Play uses automated Lint rules to block hardcoded colors and flag known performance traps like BoxWithConstraints before a PR ever gets reviewed.</li></ul><h3>Android 17 Removes Large-Screen Orientation Locks</h3><p>Starting in Android 16, the OS began ignoring orientation and aspect-ratio locks on large screens. In <strong>Android 17, the manifest opt-outs are gone completely</strong>. If your app still forces portrait mode and hopes for the best on foldables, tablets, or Googlebooks, it’s going to stretch or lose state.</p><p>In <a href="https://developer.android.com/events/dev-summit/talks/scale-your-app-for-every-screen-with-compose">Scale your app for every screen with Compose</a> (<a href="https://www.youtube.com/watch?v=SGTkTKX7qq4">Video</a>), Francesco Romano walked through the new toolkit for fixing this without drowning in boilerplate:</p><ul><li><strong>Experimental </strong><strong>MediaQuery API</strong>: Instead of duct-taping multiple platform window managers into Compose state, MediaQuery lets you declaratively track window sizes and folding postures.</li><li><strong>Stable </strong><strong>Grid and </strong><strong>FlexBox Composables</strong>: Grid handles multi-dimensional layouts in a single composable, while FlexBox handles one-dimensional space distribution and wrapping.</li><li><strong>Jetpack Navigation 3</strong>: Navigation 3 structures multi-pane flows around state and customizable “scenes” that switch cleanly between single-pane and dual-pane layouts. Plus, Clara Fok and Ian Lake showed in <a href="https://developer.android.com/events/dev-summit/talks/building-type-safe-deep-links-with-jetpack-navigation3">Building type-safe deep links with Jetpack Navigation3</a> (<a href="https://www.youtube.com/watch?v=cgmY14gf4zg">Video</a>, <a href="https://goo.gle/nav3-recipes">Nav3 Recipes</a>, <a href="https://github.com/android/nowinandroid">Now in Android</a>) how KMP-compatible DeepLinkRequest and UriDeepLinkMatcher use Kotlin Serialization to parse URIs into strongly typed NavKey objects—building synthetic back stacks lazily with withBackStack.</li><li><strong>Compose Adaptive Skill for Gemini</strong>: If you have a sprawling legacy layout, the updated adaptive skill can automatically refactor fixed screens into responsive components and wire up desktop keyboard shortcuts and cursor states.</li></ul><h3>What Else Changed in Compose (1.12 &amp; 1.13)</h3><p>Beyond adaptive layouts, four Compose sessions stood out for day-to-day UI work:</p><ol><li><strong>Use </strong><strong>TextFieldState, Not Callback Overloads</strong>: In <a href="https://developer.android.com/events/dev-summit/talks/building-reliable-text-editing-experiences-in-compose">Building reliable text editing experiences in Compose</a> (<a href="https://www.youtube.com/watch?v=1DvjkRYGs2g">Video</a>), Anastasia Soboleva and Haoyu Zhang explained why <a href="https://goo.gle/migrate_to_state_textfield">TextFieldState</a> replaces the old value / onValueChange callbacks. It updates synchronously with the keyboard (goodbye, cursor-jumping bugs), gives you TextFieldBuffer with ExpandPolicy for rich text formatting in Compose 1.12, and pairs with an upcoming Compose markup library that parses and renders live-streamed Markdown incrementally.</li><li><strong>State Management Outside the UI with Jetpack AppState</strong>: If you love Compose’s snapshot system (or Cash App’s <a href="https://github.com/cashapp/molecule">Molecule</a>) and hate writing 15-line Flow.combine chains in your ViewModel, check out <a href="https://developer.android.com/events/dev-summit/talks/take-compose-state-beyond-the-ui-with-jetpack-appstate">Take Compose state beyond the UI with Jetpack AppState</a> (<a href="https://www.youtube.com/watch?v=69QYEXymfVo">Video</a>, <a href="https://goo.gle/appstate-docs">AppState Docs</a>, <a href="https://www.github.com/android/appstate-recipes">AppState Recipes</a>). AppState Transform runs headless composable blocks off the UI thread using an eager frame clock that parks itself whenever state is idle, and AppState StateStore shares Compose state across activities and background services with automatic DataStore persistence across process death.</li><li><strong>Mesh Gradients, Morphing Shapes, and Frosted Glass</strong>: In <a href="https://developer.android.com/events/dev-summit/talks/elevate-your-apps-with-the-latest-graphics-features-in-jetpack-compose-and-android">Elevate your apps with the latest graphics features in Jetpack Compose and Android</a> (<a href="https://www.youtube.com/watch?v=TirZPDPV8Dw">Video</a>), Rebecca Franks, Aayush Chaudhary, and Rahul Ray demoed Compose 1.12 <a href="https://goo.gle/android-mesh">mesh gradients</a> (drawMesh), <a href="https://goo.gle/understanding-color">wide color gamut support</a>, Compose 1.13&#39;s PolygonShape and MorphPolygonShape (which animates shape outlines during the draw phase without triggering recomposition), progressive blur, and API 37.2&#39;s RenderNode.setBackdropRenderEffect for frosted-glass effects.</li><li><strong>Remote Compose &amp; Wear OS Widgets</strong>: In <a href="https://developer.android.com/events/dev-summit/talks/powering-interactive-surfaces-with-remote-compose">Powering interactive surfaces with Remote Compose</a> (<a href="https://www.youtube.com/watch?v=csh2Opo_wjE">Video</a>) and <a href="https://developer.android.com/events/dev-summit/talks/evolving-tiles-to-wear-widgets-using-jetpack-glance-and-remote-compose">Evolving Tiles to Wear Widgets using Jetpack Glance and Remote Compose</a> (<a href="https://www.youtube.com/watch?v=5--1viVciq4">Video</a>), Google showed how <strong>Remote Compose</strong> compiles UI into tiny, kilobyte-sized binary documents that run inside system launcher or watch surfaces — handling touch and resize events without waking your app process. Jetpack Glance now uses Remote Compose under the hood to turn full-screen Wear OS Tiles into partial-height <a href="https://goo.gle/wear-widgets">Wear Widgets</a> (<a href="https://goo.gle/wearos-tiles-widgets-migration">Migration Guide</a>, <a href="https://goo.gle/runkeeper-wearos">Runkeeper Open Beta</a>) all the way back to Wear OS 4. (Also worth watching: <a href="https://developer.android.com/events/dev-summit/talks/lessons-from-whatsapps-wear-os-journey">Lessons from WhatsApp’s Wear OS journey</a> (<a href="https://www.youtube.com/watch?v=Mi3zullvIYY">Video</a>) on taming TransformingLazyColumn and muting duplicate phone notifications at login.)</li></ol><h3>2. AI Coding Agents: The Hype vs. The Benchmark (Plus a YAML Build System)</h3><p>Every developer conference in 2026 talks about AI coding agents. What made the <strong>Tools and performance</strong> track at ADS 2026 refreshing was how brutally honest the engineering teams were about where agents fail and how Android’s tooling is changing to fix it.</p><h3>Frontier Models Complete 80% of Android Tasks — and Fail Up to 80% of Them</h3><p>In <a href="https://developer.android.com/events/dev-summit/talks/insights-into-agent-code-generation-from-android-bench">Insights into agent code generation from Android Bench</a> (<a href="https://www.youtube.com/watch?v=rIIAwylLb5Q">Video</a>), Tomáš Mlynarič explained why Python-heavy leaderboards don’t reflect Android work (<a href="https://openai.com/index/why-we-no-longer-evaluate-swe-bench-verified">Why SWE-bench Verified no longer measures frontier coding capabilities</a>). Using <a href="https://d.android.com/bench">Android Bench 2.0</a> — which grades agents on closed-source Android tasks using UI tests and a Multimodal LLM Judge — Google found that while frontier models finish around <strong>80%</strong> of tasks, they actually pass only <strong>20% to 40%</strong> of them.</p><p>Even funnier? They had to build <strong>cheating detectors</strong> into the benchmark because agents kept taking shortcuts, like tampering with test files or drawing fake static backgrounds instead of building the actual UI. And because “chatty” models get stuck in rebuild-and-rerun loops, the actual dollar cost per solved issue varies wildly from advertised token prices.</p><p>Interestingly, you don’t always need a giant cloud model. In London, Ian Ballantyne, Jose Alcérreca, and Zoe Lopez-Latorre showed in <a href="https://developer.android.com/events/dev-summit/talks/agentic-coding-workflows-with-small-models">Agentic coding workflows with small models</a> (<a href="https://www.youtube.com/watch?v=sBWgIjWU6PI">Video</a>) that with Quantization-Aware Training (cutting memory by 75%) and speculative decoding (up to 3x faster), <a href="https://ai.google.dev/gemma/docs/core/model_card_4">Gemma 4</a> solves <strong>over half</strong> of PR-sized tasks on <a href="https://developer.android.com/bench">Android Bench</a> (<a href="https://goo.gle/awty">AWTY Framework</a>) running locally at zero marginal cost — whereas frontier models cost 20x to 200x more.</p><h3>Android CLI, Studio Rabbit 2, and How to Keep Agents from Going Off the Rails</h3><p>To stop agents from flailing around in terminal sessions, Adarsh Fernando and Esteban de la Canal introduced major upgrades in <a href="https://developer.android.com/events/dev-summit/talks/whats-new-in-android-dev-tools">What’s new in Android dev tools</a> (<a href="https://www.youtube.com/watch?v=w-auFZP5gJo">Video</a>):</p><ul><li><a href="https://d.android.com/cli"><strong>Android CLI</strong></a>: Built with structured, non-interactive outputs so coding agents never hang on a [y/N] prompt. Agents can now render Compose previews without opening Android Studio, pull production crash reports straight from Firebase Crashlytics, and delta-push APK changes to devices.</li><li><strong>Single-Process Linux APK Runner</strong>: You can now run x86 Android APKs natively on a Linux desktop as a single process with Logcat output — no nested virtualization or heavyweight emulator required.</li><li><a href="https://d.android.com/studio"><strong>Android Studio</strong></a><strong> Rabbit 2</strong>: Adds <strong>Bring Your Own Agent</strong> support over the Agent Client Protocol (ACP) for Google Antigravity, Claude Code, and Codex, plus <strong>AI Change Review</strong> to inspect PRs before human review.</li></ul><p>In <a href="https://developer.android.com/events/dev-summit/talks/agentic-engineering-with-claude-code-and-android-cli">Agentic engineering with Claude Code and Android CLI</a> (<a href="https://www.youtube.com/watch?v=Mb9H43ia0kE">Video</a>), Ben Trengrove and Steven Jenkins shared three rules backed by an <a href="https://arxiv.org/pdf/2602.11988">agent modification study</a> that you can apply today:</p><ol><li><strong>Keep agent conversations under ~150,000 tokens</strong> to avoid context rot, and always run Gradle in --quiet mode so compiler logs don&#39;t eat your context window.</li><li><strong>Keep </strong><strong>AGENTS.md under 250 lines, and never let the agent edit it.</strong> Reserve it for permanent architecture rules. Letting agents append their own notes to AGENTS.md measurably lowers pass rates and burns tokens.</li><li><strong>Use deterministic hooks and vetted </strong><a href="https://developer.android.com/tools/agents/android-skills"><strong>Android Skills</strong></a> so the agent runs fast unit tests first and only boots an emulator test at the very end. (As panelists noted in <a href="https://developer.android.com/events/dev-summit/talks/agentic-coding-a-roundtable-with-industry-leaders">Agentic coding: A roundtable with industry leaders</a> (<a href="https://www.youtube.com/watch?v=megAzvXTdrc">Video</a>), AI-generated PR volume is already pushing large teams toward Bazel remote build execution just to keep CI queues from melting down.)</li></ol><h3>Lightbuild: What If Gradle Didn’t Need Imperative Build Scripts?</h3><p>If you’ve ever watched an AI agent or a human teammate break a build by messing up a complex build.gradle.kts script, <a href="https://developer.android.com/events/dev-summit/talks/declarative-agent-ready-android-builds-with-lightbuild">Declarative, agent-ready Android builds with Lightbuild</a> (<a href="https://www.youtube.com/watch?v=0mYQtt2RfoQ">Video</a>) by Scott Myers and Juan Sebastian Oviedo is a must-watch.</p><p><a href="https://goo.gle/lightbuild">Lightbuild</a> (now in experimental preview in Android Studio Canary) replaces executable build scripts with purely declarative YAML files while still using Gradle as the execution engine under the hood:</p><ul><li><strong>Instant IDE Sync via </strong><strong>resolved.deps</strong>: Instead of evaluating scripts on every sync, Lightbuild precomputes dependencies into checked-in resolved.deps files that also act as CI lockfiles.</li><li><strong>Empty-Shell App Modules</strong>: All code lives in library modules; application modules are just thin, empty shells that define flavors like demo or prod.</li><li><strong>Agent-Friendly JSON CLI</strong>: Commands like lightbuild query and lightbuild resolve output clean JSON, making module graph refactoring trivial for scripts and agents.</li></ul><h3>3. On-Device AI Gets Small Enough to Actually Ship</h3><p>For the past two years, “mobile AI” mostly meant making a REST call to a cloud LLM or shipping a model so huge it blew up low-end devices. The <strong>Intelligent Apps</strong> track tackled both problems head-on.</p><h3>Gemini Nano 4 &amp; Gemma 4 Drop from 3.6 GB to 1.1 GB of RAM</h3><p>In <a href="https://developer.android.com/events/dev-summit/talks/inside-gemini-nano-and-gemma-4-powering-on-device-intelligence">Inside Gemini Nano and Gemma 4 powering on-device intelligence</a> (<a href="https://www.youtube.com/watch?v=ekS4_gV6Ojc">Video</a>) and <a href="https://developer.android.com/events/dev-summit/talks/on-device-intelligence-optimized-performance-and-quality-using-android-ml-kit-apis">On-device Intelligence: Optimized performance and quality using Android ML Kit APIs</a> (<a href="https://www.youtube.com/watch?v=p-SZ1rWvErU">Video</a>), Sara Smoot and David Chou broke down how Google shrank <a href="https://developer.android.com/ai/gemini-nano">Gemini Nano 4</a> and <a href="https://ai.google.dev/gemma/docs/core/model_card_4">Gemma 4</a> (<a href="https://huggingface.co/collections/google/gemma-4">Hugging Face</a>, <a href="https://kaggle.com/models/google/gemma-4">Kaggle</a>):</p><ul><li><strong>2-Bit Quantization-Aware Training (QAT)</strong>: Compresses mobile checkpoints under <strong>1 GB</strong>, cutting Gemini Nano’s active memory footprint from <strong>3.6 GB down to 1.1 GB</strong>.</li><li><strong>2x Faster Than Cloud with Shared-KV Drafter Models</strong>: A tiny multi-token prediction drafter model shares the base model’s KV cache so prefills don’t have to be regenerated. Pair that with system-prompt prefix caching (which cuts processed tokens by <strong>60%</strong>), and decode latency drops by <strong>40%</strong> while saving <strong>30% to 40%</strong> battery energy.</li><li><strong>128K Context &amp; Thinking Mode for Tool Calls</strong>: Gemma 4 E2B and E4B support a <strong>128K-token context window</strong> under an Apache 2.0 license. On <a href="https://developers.google.com/ml-kit/genai/prompt/android">Gemini Nano 4</a>, enabling thinking mode jumps on-device function-calling accuracy by <strong>13 points out of 100</strong>.</li><li><strong>Save 8 MB per APK with Shared LiteRT 2.x</strong>: If you bundle your own models, Chintan Parikh and Fergus Henderson showed in <a href="https://developer.android.com/events/dev-summit/talks/mastering-on-device-intelligence-with-ml-kit-and-litert-in-google-play-services">Mastering on-device intelligence with ML Kit and LiteRT in Google Play Services</a> (<a href="https://www.youtube.com/watch?v=LiBWWJ9IKag">Video</a>) how switching to play-services-litert (<a href="https://developers.google.com/edge/litert/android">LiteRT Docs</a>) uses a shared Google Play services runtime, shaving <strong>~8 MB</strong> off your APK. Since NNAPI is going away and LiteRT 1.x is in maintenance mode, migrate to the <strong>2.x </strong><strong>CompiledModel API</strong> (LiteRt.initialize -&gt; CompiledModel.create) for up to <strong>1.4x faster GPU performance</strong> than old TFLite GPU delegates across phones, Wear OS 4+, and Android Automotive OS.</li></ul><p>Want proof that on-device AI holds up under pressure? In <a href="https://developer.android.com/events/dev-summit/talks/building-a-formula-e-co-driver-on-android-with-ml-kit-and-gemini-nano">Building a Formula E co-driver on Android with ML Kit and Gemini Nano</a> (<a href="https://www.youtube.com/watch?v=nV63eqjPeEI">Video</a>), Alastair Breeze and Oli Thompson strapped a Pixel phone inside a Formula E race car at Goodwood. Travelling at over <strong>200 km/h</strong> in brutal cockpit heat, the phone ingested 10 Hz CAN bus telemetry from a Raspberry Pi over MQTT and used Gemini Nano + the Agent Developer Kit to answer the driver’s voice questions over Bluetooth helmet audio in real time.</p><h3>Turning Your App into an MCP Server (AppFunctions) and Streaming Native UI (A2UI)</h3><p>Three new frameworks change how agents interact with your app’s code and UI:</p><ul><li><strong>Android MCP &amp; </strong><strong>AppFunctions</strong>: In <a href="https://developer.android.com/events/dev-summit/talks/integrate-your-app-with-the-android-intelligence-system">Integrate your app with the Android intelligence system</a> (<a href="https://www.youtube.com/watch?v=UsqDEfyOH2E">Video</a>) and <a href="https://developer.android.com/events/dev-summit/talks/extend-your-app-to-gemini-and-search-with-the-connected-apps-platform">Extend your app to Gemini and Search with the Connected Apps Platform</a> (<a href="https://www.youtube.com/watch?v=-4G-4w9FKDw">Video</a>), Google unveiled <strong>Android MCP</strong>, powered by the <a href="https://developer.android.com/ai/appfunctions">Jetpack AppFunctions library</a> (<a href="https://github.com/android/appfunctions">Sample Code</a>) over Android Binder IPC. You annotate Kotlin methods with AppFunctionDeclaration, write clear KDoc descriptions (skip Kotlin default arguments), and flag mutating actions with destructiveHint so Gemini knows when to ask the user for confirmation. Through the <a href="https://developers.google.com/connected-apps">Connected Apps Platform</a> (now in US preview with <strong>Gemini Developer Mode</strong>), those functions become callable directly inside Gemini and Google Search. Inside your own app, ML Kit GenAI&#39;s alpha AgentRunner (<a href="https://developer.android.com/events/dev-summit/talks/unlock-agentic-capabilities-in-your-app-with-ml-kit-genai">Unlock agentic capabilities in your app with ML Kit GenAI</a>, <a href="https://www.youtube.com/watch?v=tAy7IifZXG0">Video</a>, <a href="https://goo.gle/jetpacker">Jetpacker Sample</a>, <a href="https://goo.gle/aicore-dev-preview">AICore Preview</a>) handles the multi-turn tool execution loop for you.</li><li><strong>A2UI v0.9 (Goodbye WebViews, Hello Native Compose)</strong>: When an AI agent needs to show a custom UI — like a booking card or interactive filter — rendering a WebView feels sluggish and out of place. In <a href="https://developer.android.com/events/dev-summit/talks/let-agents-generate-ui-in-your-android-apps-with-a2ui">Let agents generate UI in your Android apps with A2UI</a> (<a href="https://www.youtube.com/watch?v=qIvsFGvlHdo">Video</a>), Anton Beloglazov and Nick Butcher introduced the Jetpack Compose renderer for <a href="https://a2ui.org/">A2UI v0.9</a> (<a href="https://goo.gle/a2ui-compose-docs">A2UI Compose Docs</a>, <a href="https://goo.gle/material3-a2ui-demo">Material 3 Demo</a>, <a href="https://github.com/android/ai-samples">AI Samples</a>). Back ends stream a declarative JSON surface model, and Compose renders it natively using your approved Material 3 component catalog, coroutine actors, and smooth layout transitions.</li><li><strong>Firebase AI Logic Spend Caps &amp; Hybrid Fallbacks</strong>: If you’re worried about a viral feature bankrupting your cloud budget, <a href="https://developer.android.com/events/dev-summit/talks/build-secure-and-cost-optimized-android-apps-with-firebase-ai-logic-and-gemini-nano-4">Build secure and cost-optimized Android Apps with Firebase AI Logic and Gemini Nano 4</a> (<a href="https://www.youtube.com/watch?v=IPKerNnpddQ">Video</a>) showed how Firebase AI Logic runs inference on Gemini Nano 4 first, falls back to the cloud automatically, enforces Play Integrity via App Check, manages WebSockets for the <strong>Gemini Live API</strong>, and lets you set hard <strong>100% spend caps</strong> that pause cloud generation before you get a surprise bill.</li></ul><h3>4. Performance, Media, and the Play Store Deadlines You Cannot Ignore</h3><p>Some of the most actionable talks at ADS 2026 were the ones that came with hard enforcement dates. Here is the quick-reference checklist of upcoming Google Play and OS requirements — and what you need to change in your codebase before they hit:</p><p><strong>Google Play Memory Performance Limit (Enforced February 2027)</strong></p><ul><li><strong>What’s changing:</strong> Exceeding the 90th-percentile memory limit in Android Vitals will directly hurt your app’s health score and Play Store visibility.</li><li><strong>What to do:</strong> Stop decoding oversized full-resolution Bitmaps (use BitmapRegionDecoder or request exact CDN dimensions), standardize on a single image loader (running both Glide and Coil duplicates heap caches), and release memory in onTrimMemory and onStop.</li><li><strong>Session &amp; docs:</strong> <a href="https://developer.android.com/events/dev-summit/talks/actionable-strategies-for-reducing-your-apps-bitmap-memory-footprint">Actionable strategies for reducing your app’s Bitmap memory footprint</a> (<a href="https://www.youtube.com/watch?v=KD_55WdEYj0">Video</a>, <a href="https://developer.android.com/memory">Android Memory Docs</a>)</li></ul><p><strong>Google Play Zero-Tap Sign-In Mandate (Enforced April 2027)</strong></p><ul><li><strong>What’s changing:</strong> Google Play will require zero-tap sign-in by April 2027 to maintain full publishing capabilities.</li><li><strong>What to do:</strong> Integrate Jetpack Credential Manager’s <a href="https://goo.gle/zero-tap-restoration">Restore Credentials API</a> so users stay signed in silently when switching phones, enable Conditional Create to automatically upgrade password users to passkeys in the background, and use the end-to-end encrypted Digital Credentials API for verified identity attributes.</li><li><strong>Session &amp; docs:</strong> <a href="https://developer.android.com/events/dev-summit/talks/delivering-seamless-sign-in-and-digital-credentials-on-android">Delivering seamless sign in and digital credentials on Android</a> (<a href="https://www.youtube.com/watch?v=YqdfIR7NUl0">Video</a>, <a href="https://goo.gle/android-passkey-demo">Passkey Demo</a>, <a href="https://goo.gle/digital-credentials-sample">Digital Credentials Sample</a>)</li></ul><p><strong>Google Play &gt;25% Code Optimization Threshold (Active Now)</strong></p><ul><li><strong>What’s changing:</strong> Play enforces app-quality thresholds requiring more than 25% DEX code optimization.</li><li><strong>What to do:</strong> Audit your app bundles locally before uploading using <a href="https://goo.gle/android-cli">Android CLI</a> and the <a href="https://goo.gle/r8-analyzer">R8 Configuration Analyzer</a>, and replace broad package-wide -keep class com.example.** wildcards with Lint-backed, type-safe annotations from <a href="https://goo.gle/jetpack-keep">Jetpack Keep</a>.</li><li><strong>Session &amp; docs:</strong> <a href="https://developer.android.com/events/dev-summit/talks/type-safe-keep-rules-and-dex-optimization">Type safe keep rules and DEX optimization</a> (<a href="https://www.youtube.com/watch?v=bwlRxGJMzWs">Video</a>, <a href="https://goo.gle/android-r8">R8 Docs</a>)</li></ul><p><strong>Removal of Large-Screen Orientation &amp; Aspect-Ratio Opt-Outs (Android 17)</strong></p><ul><li><strong>What’s changing:</strong> Android 16 ignored orientation and aspect-ratio locks on large screens, and Android 17 removes the manifest opt-outs completely.</li><li><strong>What to do:</strong> Refactor fixed-orientation activities into responsive layouts using Compose MediaQuery, Grid, FlexBox, and <a href="https://goo.gle/nav3-recipes">Jetpack Navigation 3</a> multi-pane scene strategies.</li><li><strong>Session &amp; docs:</strong> <a href="https://developer.android.com/events/dev-summit/talks/scale-your-app-for-every-screen-with-compose">Scale your app for every screen with Compose</a> (<a href="https://www.youtube.com/watch?v=SGTkTKX7qq4">Video</a>)</li></ul><p><strong>Legacy Camera1 Disabling by Play Policy (2027 / Android 18)</strong></p><ul><li><strong>What’s changing:</strong> Play policy enforcement will begin disabling deprecated Camera1 APIs next year in Android 18.</li><li><strong>What to do:</strong> Migrate any remaining Camera1 code to <a href="https://goo.gle/ads-26-camera-talk-res">Jetpack CameraX</a> 1.6 and 1.7, using CameraXViewfinder (with built-in gestures and Screen Flash) and the Feature Group API to pair 4K recording with Video Stabilization.</li><li><strong>Session &amp; docs:</strong> <a href="https://developer.android.com/events/dev-summit/talks/elevating-camera-experiences-across-devices-with-camerax-and-on-device-intelligence">Elevating camera experiences across devices with CameraX and on-device intelligence</a> (<a href="https://www.youtube.com/watch?v=mr-9hwgo10Q">Video</a>)</li></ul><p><strong>Global Android Developer Verification (Expanding Globally in 2027)</strong></p><ul><li><strong>What’s changing:</strong> Following regional enforcement in four initial markets, mandatory legal-entity verification for app packages expands globally next year to curb malware and fraud.</li><li><strong>What to do:</strong> Register your developer account in Play Console or the <a href="https://developer.android.com/console">Android Developer Console</a> (students and hobbyists get a free tier covering up to 50 devices; third-party stores can automate checks via the Developer Console and Status APIs, while unregistered sideloading requires enabling Advanced Flow with a device reboot and 24-hour timer).</li><li><strong>Session &amp; docs:</strong> <a href="https://developer.android.com/events/dev-summit/talks/android-developer-verification-paths-for-play-third-party-app-distributors-and-hobbyists">Android developer verification: Paths for Play, third party app distributors, and hobbyists</a> (<a href="https://www.youtube.com/watch?v=UL31gug0oS4">Video</a>)</li></ul><h3>Faster Tracing, Better Crashlytics Memory Dumps, and Media3 Power Savings</h3><p>To help you hit those quality bars, several core platform APIs got serious upgrades:</p><ul><li><strong>Tracing 2.0 &amp; Compose Recomposition Tracing</strong>: In <a href="https://developer.android.com/events/dev-summit/talks/trace-me-if-you-can-automated-instrumentation-and-field-profiling">Trace me if you can: Automated instrumentation and field profiling</a> (<a href="https://www.youtube.com/watch?v=eZtQgeIrmAo">Video</a>), Rahul Ravikumar showed how <strong>Tracing 2.0</strong> runs <strong>7x faster</strong>, drops the old string-length limits, exports to backends like OpenTelemetry, and tracks causal chains across coroutines with traceCoroutine. Even better: <strong>Compose 1.13 adds Recomposition Tracing</strong> (<a href="https://goo.gle/composition-tracing">Composition Tracing Guide</a>) alongside ComputedState (<a href="https://developer.android.com/events/dev-summit/talks/outperform-yourself-in-compose">Outperform yourself in Compose</a>, <a href="https://www.youtube.com/watch?v=t5ujT_o8qj0">Video</a>), so when you open <a href="https://ui.perfetto.dev/">Perfetto</a>, you can see the exact state value and call stack that triggered an unwanted recomposition.</li><li><strong>Android 17 Memory Limiter &amp; Crashlytics Heap Snapshots</strong>: In <a href="https://developer.android.com/events/dev-summit/talks/memory-troubleshooting-with-firebase-crashlytics">Memory troubleshooting with Firebase Crashlytics</a> (<a href="https://www.youtube.com/watch?v=2ruqmicLr08">Video</a>), Polina Govorkova explained how Android 17’s new <a href="https://source.android.com/docs/core/perf/memory-limiter">Memory Limiter</a> kills processes that hog total RAM (including native C++ allocations) before the whole phone freezes. Crashlytics now hooks into Android 17’s <a href="https://developer.android.com/reference/android/os/ProfilingManager">ProfilingManager</a>, <a href="https://developer.android.com/reference/android/app/ApplicationExitInfo">ApplicationExitInfo</a>, <a href="https://developer.android.com/ndk/guides/gwp-asan">GWP-ASan</a>, and <a href="https://developer.android.com/ndk/guides/arm-mte">Arm MTE</a> to give you de-obfuscated heap snapshots (<a href="https://goo.gle/crashlytics-memory">Early Access Signup</a>) and exact native use-after-free allocation sites right in the dashboard.</li><li><strong>Media3 Cuts Audio Power by 20% &amp; Drops OpenGL for Editing</strong>: In <a href="https://developer.android.com/events/dev-summit/talks/optimize-media-playback-and-maximize-reach-with-jetpack-media3-apis">Optimize media playback and maximize reach with Jetpack Media3 APIs</a> (<a href="https://www.youtube.com/watch?v=zFs0FLMGAeM">Video</a>, <a href="https://goo.gle/media3">Media3 Docs</a>, <a href="https://github.com/androidx/media">GitHub</a>), the team unveiled Media3 UI Compose, a rewritten CastPlayer that seamlessly hands off between local ExoPlayer and Cast devices, an editing pipeline decoupled from OpenGL for zero-copy hardware buffer access (and WebGPU integration), native <strong>Eclipsa Video/Audio</strong> on Android 17+, and PCM audio offload that cuts screen-off battery drain by up to <strong>20%</strong>.</li><li><strong>Cars, Cross-Device &amp; Play Policy Skills</strong>: In <a href="https://developer.android.com/events/dev-summit/talks/the-car-is-your-canvas-unlocking-android-development-for-the-road">The car is your canvas</a> (<a href="https://www.youtube.com/watch?v=8YkU3aPbQYA">Video</a>, <a href="https://goo.gle/android-cars">Android for Cars Docs</a>), <strong>Car App Library 1.9</strong> adds <strong>Park-to-Drive</strong> transitions that automatically switch a parked video streaming activity into an audio template the moment the driver shifts into gear. Meanwhile, <a href="https://developer.android.com/events/dev-summit/talks/enabling-seamless-cross-device-interactions">Enabling seamless cross-device interactions</a> (<a href="https://www.youtube.com/watch?v=2-EfHHa_NxE">Video</a>) previewed next year’s cross-platform <strong>Quick Share SDK</strong> (for Android and iOS) and <strong>Jetpack Telecom 1.1.0</strong> with 5G network slicing. And before you upload to Play, you can now run the <strong>Play policy agentic skill</strong> (<a href="https://developer.android.com/events/dev-summit/talks/app-security-in-the-agentic-era">App security in the age of intelligence</a>, <a href="https://developer.android.com/events/dev-summit/talks/decoding-play-policy-ama">Decoding Play Policy AMA</a>, <a href="https://d.android.com/studio/publish/insights">Play Policy Insights</a>) and isolate Wear OS or TV releases using modular app bundles (<a href="https://developer.android.com/events/dev-summit/talks/navigating-multi-device-quality-publishing-beyond-mobile-on-google-play">Navigating multi-device quality</a>).</li><li><strong>Shoutout to the London Community Track</strong>: If you work with Kotlin Multiplatform or DI, keep an eye out for recordings from the London Community stage at 6 Pancras Square — especially Arnaud Giuliani’s session on <strong>Koin moving dependency resolution to the Kotlin Compiler</strong> for true compile-time safety, Ash Davies’ breakdown of <strong>Jetpack Navigation Multiplatform vs. Decompose and Voyager</strong>, and Alejandra Stamato’s candid post-mortem on surviving the <strong>targetSdk 36 migration</strong>.</li></ul><p><em>What was your favorite announcement from ADS 2026? Are you excited to try Lightbuild’s YAML builds, or are you busy auditing your Bitmap memory before February 2027? Drop a comment below!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ac40c938c95" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One Codebase, Two On-Device Brains: Gemini Nano and Apple Intelligence in Compose Multiplatform]]></title>
            <link>https://medium.com/@Y4583L/one-codebase-two-on-device-brains-gemini-nano-and-apple-intelligence-in-compose-multiplatform-7f785dec5dfc?source=rss-21f8ad148566------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f785dec5dfc</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Yassine Beldi]]></dc:creator>
            <pubDate>Thu, 06 Aug 2026 21:37:47 GMT</pubDate>
            <atom:updated>2026-08-06T21:37:47.241Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EB54wlv1VM4SoaEfXaqrCA.png" /></figure><p><strong>A while back I wrote about running Gemini Nano on Android. Back then Jibify was Android-only. It isn’t anymore — so here’s the sequel.</strong></p><p>A while ago I published an article about wiring <strong>Gemini Nano</strong> into Jibify, my personal-finance app. At the time Jibify was Android-only, and the whole point was that a budgeting app could do its “smart” stuff , categorizing expenses, coaching you on your spending, without ever shipping your financial life off to someone’s server.</p><p>That article is still true. What’s changed is Jibify itself. I’ve since migrated it to <strong>Compose Multiplatform</strong>, so the same app now runs on Android <strong>AND</strong> iOS from one Kotlin codebase. Which immediately raised a question I hadn’t had to answer before: if the Android version does its AI on-device with Gemini Nano, what does the iOS version do?</p><p>The answer, it turns out, is <strong>Apple Intelligence,</strong> Apple’s own on-device model, reachable through the Foundation Models framework. Same idea, completely different SDK, different language even. This post is about how I got both of them sitting behind a single shared interface, so the rest of Jibify never has to care which one it’s talking to.</p><p>If you read the first article, think of this as okay, now do it twice, and make it look like once.</p><h3><strong>Why bother keeping it on-device at all</strong></h3><p>Quick recap for anyone who didn’t read the original, because it’s the whole reason I went down this road.</p><p>A finance app is about the worst possible thing to casually send to a cloud API. It’s your salary, your rent, the four coffees a day you’d rather not admit to. Sending all of that off to a server just to get back “this looks like a Food expense” always felt like a bad trade. On top of that, cloud calls cost money per request, they’re slower, and they’re useless the moment you’re on a plane or the subway.</p><p>So Jibify’s rule has always been the same: <strong>AI runs on the phone by default, and the cloud is only a fallback.</strong> That rule didn’t change when I moved to Compose Multiplatform. What changed is that “the phone” now means two very different phones.</p><h3><strong>The actual problem</strong></h3><p>Compose Multiplatform lets me share UI and logic across both platforms. All of Jibify’s AI features, categorization, the finance-coach chat, receipt scanning, the monthly health score, live in shared code and get written once.</p><p>But the <em>inference</em> can’t be shared. It has to happen in platform-specific code, because the two platforms couldn’t be less alike here:</p><p>- On <strong>Android</strong>, it’s Gemini Nano through ML Kit’s GenAI API. That’s plain Kotlin, so it lives in <em>androidMain</em>.</p><p>- On <strong>iOS</strong>, it’s Apple’s <em>FoundationModels</em> framework (`<em>SystemLanguageModel</em>`, `<em>LanguageModelSession</em>`). That’s Swift-only, so Kotlin can’t touch it directly, it needs a bridge.</p><p>This is exactly what Kotlin Multiplatform’s <em>`expect`/`actual` </em>is for. I write the <em>contract</em> in shared code and hand each platform its own implementation. Here’s the whole contract for on-device inference, four functions, nothing more:</p><pre>// commonMain/data/api/OnDeviceSlmService.kt<br>expect class OnDeviceSlmService() {<br><br>  suspend fun isAvailable(): Boolean<br><br>  suspend fun categorizeTransaction(<br>    amount: Double,<br>    note: String,<br>    availableCategories: List&lt;Category&gt;<br>  ): AiCategorizationResponse?<br><br>  suspend fun parseVoiceTransaction(<br>    spokenText: String,<br>    availableCategories: List&lt;Category&gt;<br>  ): AiVoiceTransactionResponse?<br>/** Free-form generation for the chat. Returns null if there&#39;s nothing to run it on. */<br>suspend fun generateText(prompt: String): String?<br>}</pre><p>Everything above this line in the app, ViewModels, screens, all of it, only ever sees this. It has no idea whether an answer came from a Google model or an Apple one, and that’s the point.</p><p>There’s a second, smaller contract too, just so the Settings screen can tell people which engine is doing the work:</p><pre>// commonMain/data/api/OnDeviceAiProvider.kt<br>/** &quot;Gemini Nano&quot; on Android, &quot;Apple Intelligence&quot; on iOS. */<br>expect fun onDeviceAiProviderName(): String<br><br>enum class OnDeviceAiStatus { AVAILABLE, DOWNLOADING, UNAVAILABLE }<br><br>expect suspend fun onDeviceAiStatus(): OnDeviceAiStatus</pre><p>Now let’s fill in the two sides.</p><h3><strong>Android: Gemini Nano (the part I already knew)</strong></h3><p>I won’t re-tell the whole first article, but here’s the short version for context. Gemini Nano is Google’s smallest Gemini model, and the key detail is that <strong>your app doesn’t ship it</strong>. It’s provided by the system through AICore on supported devices, and it runs entirely on-device. ML Kit’s GenAI API is how you reach it.</p><p>The Android `<em>actual</em>` is a lazily-initialized wrapper around an ML Kit `<em>GenerativeModel</em>`:</p><pre>// androidMain/data/api/OnDeviceSlmServiceAndroid.kt<br>actual class OnDeviceSlmService actual constructor() {<br>    private val json = Json { ignoreUnknownKeys = true }<br>    private var model: GenerativeModel? = null<br>    private val mutex = Mutex()<br>    private var isReady = false<br><br>    actual suspend fun isAvailable(): Boolean {<br>        if (isReady) return true<br>        if (!isDeviceSupported()) return false<br>        return initialize().isSuccess<br>    }<br><br>    // ...<br>}</pre><p>Two things I learned the hard way the first time around, and still guard for:</p><p>Emulators don’t have Gemini Nano. If you skip that check, `<em>isAvailable</em>()` will hang or throw on the emulator and you’ll spend an afternoon confused. The `Build.FINGERPRINT` sniffing is ugly, but it’s load-bearing. And it only exists at all on SDK 34 and up. below that, AICore simply isn’t there.</p><p>Initialization warms the model up, and downloads the weights if the device can run Nano but hasn’t fetched it yet:</p><pre>private suspend fun initialize(): Result&lt;Unit&gt; = mutex.withLock {<br>    if (isReady) return Result.success(Unit)<br>    return try {<br>        withContext(Dispatchers.IO) {<br>            var client = Generation.getClient()<br>            val status = client.checkStatus()<br>            if (status != 0) {<br>                Log.i(TAG, &quot;Gemini Nano status=$status, triggering download…&quot;)<br>                withTimeoutOrNull(10_000L) { client.download().collect { } }<br>                client.close()<br>                client = Generation.getClient()<br>            }<br><br>            // Don&#39;t trust checkStatus alone — prove the model actually answers.<br>            val testResponse = withTimeoutOrNull(15_000L) { client.generateContent(&quot;Say hi&quot;) }<br>            val text = testResponse?.candidates?.firstOrNull()?.text<br>            if (text.isNullOrBlank()) {<br>                client.close()<br>                return@withContext Result.failure(Exception(&quot;Nano test inference failed/empty&quot;))<br>            }<br><br>            model = client<br>            isReady = true<br>            Result.success(Unit)<br>        }<br>    } catch (e: Exception) {<br>        Log.e(TAG, &quot;Gemini Nano unavailable on this device&quot;, e)<br>        Result.failure(e)<br>    }<br>}</pre><p>That little ”<em>Say hi</em>” smoke test earns its keep. On-device models will happily tell you they’re “ready” and then fall over on the first real request. One throwaway call up front turns a runtime surprise into an honest `<em>isAvailable() == false</em>`.</p><p>The inference itself is short. The real work is in the prompt, small models need to be told, in no uncertain terms, to give you <em>only</em> JSON:</p><pre>actual suspend fun categorizeTransaction(<br>    amount: Double, note: String, availableCategories: List&lt;Category&gt;<br>): AiCategorizationResponse? {<br>    if (model == null || note.isBlank()) return null<br>    return try {<br>        withContext(Dispatchers.Default) {<br>            val categoryNames = availableCategories.joinToString(&quot;, &quot;) { it.name }<br>            val prompt = &quot;&quot;&quot;<br>                Categorize this expense. Note: &quot;$note&quot;, Amount: $amount.<br>                Categories: [$categoryNames].<br>                Pick the best category (exact name). Classify as NEED, MUST, or WANT.<br>                Generate 1-3 comma-separated keyword tags.<br>                Reply ONLY with JSON:<br>                {&quot;categoryName&quot;: &quot;Food&quot;, &quot;natureOfSpend&quot;: &quot;WANT&quot;, &quot;tags&quot;: &quot;coffee, breakfast&quot;}<br>            &quot;&quot;&quot;.trimIndent()<br>            val text = runPrompt(prompt) ?: return@withContext null<br>            json.decodeFromString&lt;AiCategorizationResponse&gt;(extractJsonObject(text))<br>        }<br>    } catch (e: Exception) { null }<br>}</pre><p>And because small models can’t resist wrapping their JSON in markdown fences and a friendly little preamble, every response goes through a dumb-but-reliable extractor before it ever hits the parser:</p><pre>/** Grab the first {...} out of a reply, ignoring fences and chatter. */<br>private fun extractJsonObject(text: String): String {<br>    val cleaned = text.replace(&quot;```json&quot;, &quot;&quot;).replace(&quot;```&quot;, &quot;&quot;).trim()<br>    val start = cleaned.indexOf(&#39;{&#39;)<br>    val end = cleaned.lastIndexOf(&#39;}&#39;)<br>    return if (start &gt;= 0 &amp;&amp; end &gt; start) cleaned.substring(start, end + 1) else cleaned<br>}</pre><p>If there’s one thing to steal from either of my articles, it’s this: never hand an on-device model’s raw text straight to `decodeFromString`. It will betray you.</p><p>So far, none of this is new. it’s the Android story from last time. Here’s the part I hadn’t written before.</p><h3><strong>iOS: Apple Intelligence (the new half)</strong></h3><p>This is where the multiplatform move got interesting, because Apple’s Foundation Models framework is Swift-only. Kotlin/Native can’t call it. So instead of forcing it, I flipped the direction: I define a callback interface <em>*in Kotlin*</em>, and let <em>*Swift*</em> implement it.</p><p>The Kotlin side declares a handler and a little bridge object that Swift fills in when the app launches:</p><pre>// iosMain/data/api/OnDeviceSlmServiceIos.kt<br>interface AppleIntelligenceHandler {<br>    suspend fun processPrompt(prompt: String): String?<br>}<br><br>object AppleIntelligenceBridge {<br>    var handler: AppleIntelligenceHandler? = null<br>    /** &quot;available&quot; | &quot;downloading&quot; | anything else = unavailable. Swift sets this at launch. */<br>    var status: String? = null<br>}</pre><p>The iOS `<em>actual</em>` then mostly just delegates. It builds the same prompts as Android, same JSON discipline, and passes the raw text to whatever Swift registered:</p><pre>actual class OnDeviceSlmService actual constructor() {<br>    private val json = Json { ignoreUnknownKeys = true }<br><br>    actual suspend fun isAvailable(): Boolean =<br>        AppleIntelligenceBridge.handler != null<br><br>    actual suspend fun generateText(prompt: String): String? {<br>        val handler = AppleIntelligenceBridge.handler ?: return null<br>        return handler.processPrompt(prompt)<br>    }<br><br>    actual suspend fun categorizeTransaction(/* … */): AiCategorizationResponse? {<br>        val handler = AppleIntelligenceBridge.handler ?: return null<br>        val prompt = /* the same JSON-only prompt as Android */ &quot;&quot;<br>        val raw = handler.processPrompt(prompt) ?: return null<br>        return try {<br>            val clean = raw.trim().removePrefix(&quot;```json&quot;).removePrefix(&quot;```&quot;).removeSuffix(&quot;```&quot;).trim()<br>            json.decodeFromString&lt;AiCategorizationResponse&gt;(clean)<br>        } catch (e: Exception) { null }<br>    }<br>}</pre><p>Here’s the bit that genuinely surprised me: a Kotlin `<em>suspend fun</em>` shows up on the Swift side as an `<em>async</em>` function, for free. So the Swift implementation can just `<em>await</em>` Apple’s model and hand the text back. No manual callback plumbing, no continuation juggling:</p><pre>// iosApp/AppleIntelligenceHandler.swift<br>import ComposeApp<br>#if canImport(FoundationModels)<br>import FoundationModels<br>#endif<br><br>class SwiftAppleIntelligenceHandler: NSObject, AppleIntelligenceHandler {<br>    func processPrompt(prompt: String) async throws -&gt; String? {<br>        #if canImport(FoundationModels)<br>        if #available(iOS 26.0, *) {<br>            let model = SystemLanguageModel.default<br>            guard case .available = model.availability else {<br>                print(&quot;[AppleIntelligence] not available: \(model.availability)&quot;)<br>                return nil<br>            }<br>            do {<br>                let session = LanguageModelSession()<br>                let response = try await session.respond(to: prompt)<br>                return response.content<br>            } catch {<br>                // Guardrails, context limits, whatever fail soft so the shared<br>                // layer just falls back to cloud instead of crashing.<br>                print(&quot;[AppleIntelligence] respond failed: \(error)&quot;)<br>                return nil<br>            }<br>        }<br>        #endif<br>        return nil<br>    }<br>}</pre><p>Registration happens once, at launch, in the `AppDelegate`:</p><p>If Apple Intelligence isn’t available, the handler just stays `nil`, `i<em>sAvailable()`</em> returns `<em>false</em>`, and the shared code never even tries. No special cases anywhere else.</p><h3><strong>The gotcha that ate an afternoon: the Simulator lies</strong></h3><p>I’ll save you the trip I took, because this one is genuinely nasty.</p><p>On the iOS Simulator, `<em>SystemLanguageModel.default.availability</em>` can cheerfully report `.<em>available</em>`, and then the first actual <em>respond(to:) </em>call blows up with a <em>com.apple.modelcatalog</em> “<em>no underlying assets</em>” error, because the Simulator ships no model weights at all. It says yes, then it says no.</p><p>So availability can’t be naive. I treat the Simulator as unavailable on purpose:</p><pre>func appleIntelligenceStatusString() -&gt; String {<br>    #if targetEnvironment(simulator)<br>    // Simulator has no model assets. availability lies and says .available,<br>    // then respond() fails. Call it unavailable so we fall back to cloud.<br>    return &quot;unavailable&quot;<br>    #else<br>    #if canImport(FoundationModels)<br>    if #available(iOS 26.0, *) {<br>        switch SystemLanguageModel.default.availability {<br>        case .available: return &quot;available&quot;<br>        case .unavailable(let reason):<br>            if case .modelNotReady = reason { return &quot;downloading&quot; }<br>            return &quot;unavailable&quot;<br>        @unknown default: return &quot;unavailable&quot;<br>        }<br>    }<br>    #endif<br>    return &quot;unavailable&quot;<br>    #endif</pre><p>There’s a nice symmetry to it, actually. Android sniffs out emulators, iOS short-circuits the Simulator, both platforms have learned not to trust their fake devices. Which is the real lesson: on-device AI is one of those features you simply cannot test without real hardware in your hand.</p><h3><strong>Making it all look like one thing</strong></h3><p>Both platforms now implement the same `OnDeviceSlmService`, so the shared `AiServiceCoordinator` gets to be the one place that decides where a request runs. The rule is boring, which is how I like it: use on-device if it’s there, otherwise use the cloud key, otherwise give back `null`.</p><pre>// commonMain/data/api/AiServiceCoordinator.kt<br>class AiServiceCoordinator(<br>    private val cloudAiService: AiCategorizationService,<br>    private val onDeviceSlmService: OnDeviceSlmService<br>) {<br>    private suspend fun shouldUseOnDevice(): Boolean =<br>        onDeviceSlmService.isAvailable()<br><br>    /** Is there any backend at all — on-device, or a cloud key the user set up? */<br>    suspend fun isAiAvailable(apiKey: String?): Boolean =<br>        onDeviceSlmService.isAvailable() || !apiKey.isNullOrBlank()<br><br>    private suspend fun generate(apiKey: String?, prompt: String): String? {<br>        if (shouldUseOnDevice()) {<br>            val onDevice = onDeviceSlmService.generateText(prompt)<br>            if (!onDevice.isNullOrBlank()) return onDevice<br>        }<br>        return if (!apiKey.isNullOrBlank())<br>            cloudAiService.generateText(apiKey, prompt) else null<br>    }<br>}</pre><p>Once that exists, every feature is just a prompt sitting on top of `generate()`. The finance-coach chat, for instance:</p><pre>suspend fun chat(apiKey: String?, conversationHistory: String, financialContext: String): String? {<br>    val prompt = buildChatPrompt(conversationHistory, financialContext)<br>    if (shouldUseOnDevice()) {<br>        val onDevice = onDeviceSlmService.generateText(prompt)<br>        if (!onDevice.isNullOrBlank()) return onDevice<br>    }<br>    if (!apiKey.isNullOrBlank()) return cloudAiService.generateText(apiKey, prompt)<br>    return null<br>}</pre><p>The same handful of lines powers the whole set — the health score, the daily tip, spending-trend insights, subscription detection, budget-pace warnings, saving-goal nudges, natural-language search, and AI receipt parsing. Each one is maybe fifteen lines: build a prompt, call `generate()`, pull out the JSON. Written once, it runs on Gemini Nano, on Apple Intelligence, and on the cloud, and I never had to think about which.</p><p>And since `isAiAvailable()` is right there, the UI can be honest about it — the voice mic only shows up when something can actually answer, instead of teasing a feature that isn’t there.</p><h3><strong>The wiring, in about three lines</strong></h3><p>Dependency injection ties it off. There’s exactly one place that declares any of this, and it’s in shared code:</p><pre>// commonMain/di/AppModule.kt<br>single { OnDeviceSlmService() }                 // resolves to each platform&#39;s actual<br>single { AiCategorizationService() }            // the cloud fallback<br>single { AiServiceCoordinator(get(), get()) }   // what every ViewModel injects</pre><p>Every ViewModel just asks for `AiServiceCoordinator` and gets on with its life. Android resolves `OnDeviceSlmService()` to the Gemini Nano implementation, iOS resolves it to the Apple Intelligence bridge, and the injection graph doesn’t know or care about the difference. Neither does the UI.</p><p><em>*Jibify is a Compose Multiplatform personal-finance app, and every snippet here is from its real source. If you read my earlier Gemini-Nano-on-Android piece, this is the multiplatform follow-up , and if you didn’t, this one stands on its own.*</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f785dec5dfc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why We Chose KMP Over React Native: It’s an Architecture Bet, Not a Framework Preference]]></title>
            <link>https://medium.com/@Y4583L/why-we-chose-kmp-over-react-native-its-an-architecture-bet-not-a-framework-preference-e9ad0a7dffd5?source=rss-21f8ad148566------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9ad0a7dffd5</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Yassine Beldi]]></dc:creator>
            <pubDate>Fri, 31 Jul 2026 10:28:20 GMT</pubDate>
            <atom:updated>2026-07-31T11:36:52.633Z</atom:updated>
            <content:encoded><![CDATA[<p>Every mobile team eventually runs into the same headaches: maintaining two separate codebases for iOS and Android is expensive, slow, and double the work for the exact same features.<br>For a long time, React Native was the go-to answer. On paper, it sounds great: write JavaScript once, leverage a huge web ecosystem, and ship features fast. But once your app grows, the reality hits. React Native forces you to wrap your entire mobile application inside a JavaScript runtime engine. When we re-evaluated our long-term mobile strategy, we realized we didn’t want a framework that forces us to compromise on native quality just to save time. We wanted an architecture that actually scales.<br>Here is why Kotlin Multiplatform (KMP) is winning the modern mobile architecture battle, and why it’s fundamentally different from React Native.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v1XeEFO5fLyvWwrX9y0V7g.png" /></figure><h3><strong>The Core Architectural Difference</strong></h3><p>To understand why KMP feels so different, you have to look at how both approaches talk to the underlying operating system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CKJ0GMoDz_Cx6XHZZt8s-A.png" /></figure><p>React Native bundles a JavaScript engine (Hermes) right inside your app binary. Every time your JS code needs to talk to native device features or update the UI, it has to serialize data and send it across a bridge/JSI layer.</p><p>KMP compiles shared code directly into target native formats. On Android, it turns into regular JVM bytecode. On iOS, Kotlin Native compiles straight to a native .framework file via LLVM.<br>There is no extra JS engine bundled in. No bridge. And kind of zero performance penalties on iOS.</p><h3><strong>Code Breakdown: Accessing Native Hardware</strong></h3><p>Let’s look at a concrete example: fetching the device’s current battery level.</p><p><strong>The React Native Approach</strong></p><p>In React Native, you can’t just call native APIs directly. You have to write native code on both sides, bridge it, and handle it asynchronously from JavaScript.</p><p><strong>iOS Native Side (</strong><strong>BatteryModule.swift):</strong></p><pre>import Foundation<br><br>@objc(BatteryModule)<br>class BatteryModule: NSObject {<br>  <br>  @objc static func requiresMainQueueSetup() -&gt; Bool {<br>    return true<br>  }<br><br>  @objc func getBatteryLevel(_ resolve: @escaping RCTPromiseResolveBlock, <br>                           rejecter reject: @escaping RCTPromiseRejectBlock) {<br>    UIDevice.current.isBatteryMonitoringEnabled = true<br>    let level = UIDevice.current.batteryLevel<br>    if level &lt; 0 {<br>      reject(&quot;BATTERY_ERROR&quot;, &quot;Battery level unavailable&quot;, nil)<br>    } else {<br>      resolve(Int(level * 100))<br>    }<br>  }<br>}</pre><p><strong>JavaScript Side (</strong><strong>BatteryService.js):</strong></p><pre>import { NativeModules } from &#39;react-native&#39;;<br>const { BatteryModule } = NativeModules;<br><br>export async function fetchBatteryLevel() {<br>  try {<br>    const level = await BatteryModule.getBatteryLevel();<br>    return level;<br>  } catch (error) {<br>    console.error(&quot;Failed to fetch battery level&quot;, error);<br>    return null;<br>  }<br>}</pre><p>Notice the overhead here: asynchronous promises for a simple hardware property, boilerplate bridge setup, and a complete loss of type safety across the JS/native boundary.</p><h3>The KMP Approach (expect / actual)</h3><p>KMP solves this natively using Kotlin’s expect and actual declarations.</p><p><strong>Shared Kotlin Code (</strong><strong>commonMain):</strong></p><pre>// Define the contract in shared code<br>expect class BatteryManager() {<br>    fun getBatteryLevel(): Int<br>}</pre><p><strong>iOS Kotlin Code (</strong><strong>iosMain):</strong></p><pre>import platform.UIKit.UIDevice<br><br>// Direct access to native iOS APIs right inside Kotlin!<br>actual class BatteryManager {<br>    actual fun getBatteryLevel(): Int {<br>        UIDevice.current.isBatteryMonitoringEnabled = true<br>        val level = UIDevice.current.batteryLevel<br>        return (level * 100).toInt()<br>    }<br>}</pre><p><strong>Calling Shared Logic in Swift (</strong><strong>iOS App):</strong> Because KMP produces actual native headers, Swift consumes your shared Kotlin code as if it were a local Swift library:</p><pre>import SharedFramework<br><br>func checkBattery() {<br>    let batteryManager = BatteryManager()<br>    let level = batteryManager.getBatteryLevel() // Synchronous, fully typed!<br>    print(&quot;Battery level: \(level)%&quot;)<br>}</pre><p>No promises needed for sync properties, no JSON conversion, and no runtime surprises.</p><h3><strong>Why Logic-First Sharing Works Better</strong></h3><p>React Native focuses heavily on sharing UI. But forcing iOS and Android to share the exact same UI layer leads to subtle issues:</p><ol><li><strong>UX Compromises:</strong> iOS users expect native scroll physics, sheet interactions, and Apple HIG guidelines. Android users expect Material behavior. Trying to force both into one wrapper often ends up in a tangled mess of platform if/else checks inside your components.</li><li><strong>Dependency Hell:</strong> Upgrading React Native or npm packages frequently breaks native builds whenever Xcode or Gradle get updated.</li></ol><h3>KMP’s Way of Doing Things</h3><p>KMP gives you the freedom to share what makes sense, without forcing a fake UI wrapper over everything:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VpIStdkyfbQgazzpvalxQw.png" /></figure><p>You write your database logic, network calls, and state management once in Kotlin. On iOS, your engineers bind that state straight to <strong>SwiftUI</strong>. On Android, they bind it to <strong>Jetpack Compose</strong>. Or You can also have a shared UI with Compose Multiplatform.</p><p>You eliminate the vast majority of duplicated work, but your app still feels 100% native on both platforms.</p><h3><strong>Quick Comparison</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BbUhH4bPKL3MGmZYcEoFOQ.png" /></figure><h3><strong>The Verdict</strong></h3><p>Choosing KMP isn’t about bashing web tools, it’s about picking the right architecture for the long run.</p><p>React Native can still be fine for fast prototypes or web-focused teams porting basic apps. But for teams building high-performance, maintainable mobile applications, <strong>KMP gives you the benefits of code sharing without stripping away the power of native development.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9ad0a7dffd5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Supercharge Your Android App with On-Device AI: A Practical Guide to Gemini Nano]]></title>
            <link>https://medium.com/@Y4583L/supercharge-your-android-app-with-on-device-ai-a-practical-guide-to-gemini-nano-d9f6cccb39e6?source=rss-21f8ad148566------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9f6cccb39e6</guid>
            <category><![CDATA[gemini]]></category>
            <category><![CDATA[small-language-model]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Yassine Beldi]]></dc:creator>
            <pubDate>Mon, 13 Apr 2026 15:06:58 GMT</pubDate>
            <atom:updated>2026-04-13T15:07:54.903Z</atom:updated>
            <content:encoded><![CDATA[<p>As Android developers, we’re constantly looking for ways to make our apps smarter and more contextual. While cloud-based Large Language Models (LLMs) are powerful, they require an internet connection, introduce latency, and can raise privacy concerns with sensitive user data.</p><p>Enter <strong>Gemini Nano</strong>: Google’s Small Language Model (SLM) built specifically to run natively on Android devices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B_gHnQNqZnAl4RusZoCRlA.png" /></figure><p>In this article, I’ll walk you through how to integrate Gemini Nano into your Android app, leveraging the ML Kit GenAI Prompt API. I recently implemented this architecture in my own financial tracking app, <a href="https://play.google.com/store/apps/details?id=com.jibify"><strong>Jibify</strong></a> (download it on the Play Store to see these features in action!). Jibify uses on-device AI to automatically categorize transactions and parse natural voice inputs, all without ever sending your private financial data to a server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sbOmA6szYgpFOXGMih1puQ.png" /><figcaption>Jibify App Local SLM Chat</figcaption></figure><h3>Understanding Gemini Nano Versions</h3><p>Depending on the device’s hardware constraints, Android’s AICore dynamically provisions different versions of the Gemini Nano model:</p><ul><li><strong>Gemini Nano 1</strong>: Targetted for standard memory devices (like the Pixel 8 and Pixel 8a). It provides excellent reasoning for most text-based categorization tasks.</li><li><strong>Gemini Nano 2</strong>: Targetted for devices with more robust RAM and NPU capabilities (like the Pixel 8 Pro, Pixel 9 series, and Galaxy S24 series). This version handles larger, more complex inputs and generates higher-quality output at even lower latency.</li></ul><p>Regardless of the device, AICore handles downloading and updating the correct model version seamlessly in the background, so you can write your code once.</p><h3>The Advantages of On-Device AI</h3><p>Before diving into the code, let’s look at why you’d choose Gemini Nano over a cloud solution like the Gemini Pro API:</p><ol><li><strong>Privacy By Design</strong>: User data never leaves the device. This is a game-changer for financial, health, or journaling apps.</li><li><strong>Offline Support</strong>: The model works perfectly in airplane mode or subways.</li><li><strong>Zero Cost per API Call</strong>: Aside from app size or initial setup, inference is handled by the user’s processor, meaning zero server inference costs for you.</li></ol><h3>Prerequisites &amp; Device Limitations</h3><p>Currently, Gemini Nano relies on Android’s localized AI Core capabilities. Running an SLM requires specific hardware, so you want to ensure the device is supported before attempting to load it.</p><p>Here is a handy utility check. We skip emulators and require at least API 34 (Android 14):</p><pre>fun isDeviceSupported(): Boolean {<br>    val isEmulator = android.os.Build.FINGERPRINT.startsWith(&quot;generic&quot;) ||<br>        android.os.Build.FINGERPRINT.contains(&quot;emulator&quot;, ignoreCase = true) ||<br>        android.os.Build.MODEL.contains(&quot;Emulator&quot;, ignoreCase = true)<br>        // ... (other emulator checks)<br>    return android.os.Build.VERSION.SDK_INT &gt;= 34 &amp;&amp; !isEmulator<br>}</pre><h3>Step 1: Initializing the Model Safely</h3><p>We use the ML Kit GenAI Prompt API (com.google.mlkit.genai.prompt.Generation). The system manages the model payload, so we only download the model lazily if it&#39;s not already cached on the user&#39;s device.</p><p>Since initialization involves disk reads and potentially network downloads, we wrap it in a neat, thread-safe Coroutine setup using a Mutex:</p><pre>class OnDeviceSlmService(private val context: Context) {<br>    private var model: GenerativeModel? = null<br>    private val mutex = Mutex()<br>    private var _isReady = false<br>    suspend fun initialize(): Boolean = mutex.withLock {<br>        if (_isReady) return true<br>        return try {<br>            withContext(Dispatchers.IO) {<br>                var client = Generation.getClient()<br>                val status = client.checkStatus()<br>                <br>                // Trigger download if the model isn&#39;t active on the device<br>                if (status != 0) {<br>                    try {<br>                        client.download().collect { /* track progress if needed */ }<br>                    } catch (e: Exception) {<br>                        return@withContext false<br>                    }<br>                    client.close()<br>                    client = Generation.getClient() // Re-acquire client once downloaded<br>                }<br>                // Perform a sanity check:<br>                val testResponse = withTimeoutOrNull(15_000L) {<br>                    client.generateContent(&quot;Say hi&quot;)<br>                }<br>                <br>                if (testResponse?.candidates?.firstOrNull()?.text.isNullOrBlank()) {<br>                    return@withContext false<br>                }<br>                model = client<br>                _isReady = true<br>                true<br>            }<br>        } catch (e: Exception) {<br>            false<br>        }<br>    }<br>}</pre><p>By checking client.checkStatus(), we seamlessly handle the &quot;download on demand&quot; scenario. We also run a quick &quot;Say hi&quot; prompt with a timeout to verify the hardware is capable of executing inferences smoothly.</p><h3>Step 2: Prompt Engineering for Structured Data</h3><p>Once the model is ready, we want it to do some heavy lifting. In our financial app example, we want the AI to read a user’s expense note (“Uber to work”) and pick the exact correct category from a dynamic list in our database.</p><p>To get reliable, programmatic outputs from an SLM, we must <strong>force it to return JSON</strong>.</p><pre>suspend fun categorizeTransaction(<br>    amount: Double,<br>    note: String,<br>    availableCategories: List&lt;Category&gt;<br>): AiCategorizationResponse? {<br>    if (model == null || note.isBlank()) return null<br>    return withContext(Dispatchers.Default) {<br>        val categoryNamesList = availableCategories.joinToString(&quot;, &quot;) { it.name }<br>        <br>        // Strict prompting is key to good SLM results<br>        val prompt = &quot;&quot;&quot;<br>            Categorize this expense. Note: &quot;$note&quot;, Amount: $amount.<br>            Categories: [$categoryNamesList].<br>            Pick the best category (exact name). Classify as NEED, MUST, or WANT.<br>            Reply ONLY with JSON: {&quot;categoryName&quot;: &quot;Food&quot;, &quot;natureOfSpend&quot;: &quot;WANT&quot;}<br>        &quot;&quot;&quot;.trimIndent()<br>        val text = runPrompt(prompt) ?: return@withContext null<br>        <br>        // ... (JSON clean up step later)<br>    }<br>}<br>private suspend fun runPrompt(prompt: String): String? {<br>    val response = model?.generateContent(prompt)<br>    return response?.candidates?.firstOrNull()?.text?.trim()<br>}</pre><p><strong>Pro Tip:</strong> Even though Gemini Nano is very capable, it still benefits heavily from few-shot prompting or extremely clear negative bounds (“Reply ONLY with JSON”).</p><h3>Step 3: Cleaning Up the Responses</h3><p>A common hurdle with LLMs/SLMs is their tendency to wrap JSON responses in Markdown code blocks like this:</p><pre>{&quot;categoryName&quot;: &quot;Transport&quot;, &quot;natureOfSpend&quot;: &quot;NEED&quot;}json</pre><p>Attempting to pass this directly into Kotlin Serialization (Json.decodeFromString) will crash your app. Always add a sanitization step to strip markdown and extract the raw JSON:</p><pre>val jsonText = text<br>    .replace(&quot;```json&quot;, &quot;&quot;)<br>    .replace(&quot;```&quot;, &quot;&quot;)<br>    .trim()<br>    .let { t -&gt;<br>        // Extract strictly what is inside the curly braces<br>        val start = t.indexOf(&#39;{&#39;)<br>        val end = t.lastIndexOf(&#39;}&#39;)<br>        if (start &gt;= 0 &amp;&amp; end &gt; start) t.substring(start, end + 1) else t<br>    }<br>// Now safe to deserialize<br>val result = Json.decodeFromString&lt;AiCategorizationResponse&gt;(jsonText)</pre><p>By combining a strict prompt with a robust string-cleaning utility, you can achieve nearly 99% accuracy when extracting structured data models from unstructured AI outputs.</p><h3>Eligible Devices</h3><p>Currently, Gemini Nano relies on Android’s AICore framework. Because running an SLM requires significant hardware resources (primarily RAM and Neural Processing Units / NPU), the list of officially supported devices is curated:</p><ul><li><strong>Google Pixel Series</strong>: Pixel 8 Pro, Pixel 8, Pixel 8a, and the entire Pixel 9 series≥.</li><li><strong>Samsung Galaxy Series</strong>: Samsung Galaxy S24 series≥, Z Fold 6≥, and Z Flip 6≥.</li><li>Other flagship devices from Motorola, Xiaomi, and related OEMs launching with localized hardware NPUs and Android 14+ AICore support.</li></ul><p>Because you cannot guarantee your user has a Nano-supported device, your application architecture <em>must</em> account for fallback scenarios.</p><h3>The Fallback Pattern: Cloud vs. Edge</h3><p>A strong Android AI architecture doesn’t rely solely on the SLM. In our Jibify example, we use a classic <strong>Coordinator Pattern</strong> (AiServiceCoordinator.kt) to route requests.</p><ul><li><strong>When to use Gemini Nano (Edge):</strong> Tasks requiring high privacy (parsing financial data), zero latency offline operations, short summarizations, or local text categorization.</li><li><strong>When to use Gemini Pro (Cloud):</strong> Complex reasoning, logic requiring large context windows, tasks needing up-to-date internet knowledge, or when the user’s device doesn’t support Nano.</li></ul><p>Here is how you can implement a seamless fallback:</p><pre>class AiServiceCoordinator(<br>    private val cloudService: AiCategorizationService,<br>    private val slmService: OnDeviceSlmService<br>) {<br>    suspend fun categorizeTransaction(<br>        apiKey: String,<br>        amount: Double,<br>        note: String,<br>        availableCategories: List&lt;Category&gt;<br>    ): AiCategorizationResponse? {<br>        <br>        // 1. Try On-Device Nano First<br>        if (slmService.isReady) {<br>            val result = slmService.categorizeTransaction(amount, note, availableCategories)<br>            if (result != null) return result<br>            <br>            Log.d(TAG, &quot;Nano routing failed, falling back to cloud&quot;)<br>        }<br>        <br>        // 2. Fall back to Cloud (Gemini Pro/Flash API)<br>        return cloudService.categorizeTransaction(apiKey, amount, note, availableCategories)<br>    }<br>}</pre><p>This ensures that users with premium hardware enjoy zero-latency, private, and free inference, while users on older devices seamlessly consume the cloud API at the cost of slight latency.</p><h3>Conclusion</h3><p>Implementing Gemini Nano via the ML Kit GenAI Prompt API unlocks magical, context-aware features natively on the Android hardware. From voice parsing and text summarization to intent extraction, you can build hyper-intelligent experiences that respect user privacy and operate completely offline.</p><p>By combining Nano with a sturdy Cloud API fallback pattern, you create a robust app architecture ready for the future.</p><p>If you are an Android developer, now is the time to start experimenting with Small Language Models. Your users’ batteries (and privacy!) will thank you.</p><p><em>Happy Coding! Let me know in the comments how you plan to use Gemini Nano in your apps!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9f6cccb39e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[We’re Coding Faster, but Are We Still Engineers?]]></title>
            <link>https://medium.com/@Y4583L/were-coding-faster-but-are-we-still-engineers-c0607ff14a95?source=rss-21f8ad148566------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0607ff14a95</guid>
            <category><![CDATA[peer-review]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[coding-challenge]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Yassine Beldi]]></dc:creator>
            <pubDate>Wed, 08 Apr 2026 14:11:48 GMT</pubDate>
            <atom:updated>2026-04-08T14:17:37.153Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve been watching our velocity charts lately, and honestly? They look amazing. We’re shipping features at a pace that would have seemed like science fiction a few years ago, and most of that is thanks to the AI sitting in our IDEs. But if we’re being honest with ourselves, there’s a quiet, creeping cost to all this speed. We’re starting to trade the actual “craft” of engineering for the convenience of a generated snippet, and that trade-off is more dangerous than it looks on a dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OwyxGuBqR87VdUkqJHf0Tg.png" /></figure><h3>The “Looks Good to Me” Trap</h3><p>The biggest issue right now is the breakdown of the code review. When you spend two hours fighting with a logic problem, you know that code inside and out. When an AI spits out a solution in two seconds, you’re just a spectator. It’s incredibly tempting to skim an AI-generated PR, see that the tests passed, and hit “merge” without actually understanding the “why” behind the logic. This “validation gap” is where the most annoying bugs hide, the kind that don’t break a unit test but absolutely wreck a production environment because of some subtle, unintended behavior the AI couldn’t have predicted.</p><h3>Security and the Frankenstein Codebase</h3><p>Then there’s the security side of things. LLMs are basically the world’s best copy-pasters, but they don’t actually care about our specific security protocols. They’ll happily suggest an outdated library or a vulnerable auth pattern just because it was common in their training data. If we aren’t manually auditing every line, we’re basically leaving the keys under the mat.</p><p>On top of that, we’re seeing a real fragmentation in how we write. If three different devs are using three different AI agents with three different prompting styles, the codebase starts to look like a patchwork quilt. Without a unified standard, the architecture becomes brittle and a nightmare for whoever has to maintain it six months from now.</p><h3>The 18-Month Wall: When Speed Becomes Stagnant</h3><p>There is a pattern emerging in teams that lean too heavily on AI: the first three months feel like a superpower, with features flying out the door. But around the 18-month mark, many of these same teams hit a wall. They realize they’ve accumulated what experts call <strong>“Comprehension Debt.”</strong> Because the developers were essentially “directing” the AI rather than deeply building the logic themselves, they lost the shared mental model of how the system actually fits together. When a complex bug inevitably appears, no one on the team can explain why certain architectural choices were made. As noted in the <a href="https://rocketdevs.com/blog/AI-Technical-Debt-Crisis"><strong>AI Technical Debt Crisis</strong></a><strong>,</strong> the “instant” code of last year quickly becomes the unfixable legacy code of today.</p><h3>Reclaiming the Driver’s Seat</h3><p>To keep from losing our “engineering muscle,” we have to find a better balance. AI should be the intern that handles the boring, repetitive boilerplate — not the architect making the big decisions. We need to make sure we’re still spending time coding manually and digging into the documentation, or we’re going to wake up in three years and realize we don’t actually know how our own systems work.</p><p>Implementing rigorous peer reviews and holding ourselves to a standard where we never merge something we couldn’t explain on a whiteboard is the only way to stay in control. Speed is great, but it’s worthless if we’re just building a house of cards.</p><h3>Final Thoughts</h3><p>Ultimately, AI is a tool, not a replacement for the curiosity that brought most of us into engineering in the first place. It’s okay to let it handle the grunt work, but we can’t let it do our thinking for us. At the end of the day, our value isn’t measured by how many lines of code we can generate in a minute; it’s measured by our ability to understand, question, and actually care about what we’re building.</p><p>Let’s make sure that when we look back at our projects a year from now, we see a reflection of our own expertise and craftsmanship, not just a collection of successful prompts. Speed is a nice bonus, but building something that lasts — and knowing exactly why it works — is what makes us engineers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0607ff14a95" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>