How Android Apps Handle Real-Time Local Processing
Android's on-device machine learning stack lets apps run inference, image recognition, and text processing locally without sending data to servers, reducing latency and protecting privacy.
Loading…
Topic
78 posts about Android. Every summary links to the original.
See the idea
Android's on-device machine learning stack lets apps run inference, image recognition, and text processing locally without sending data to servers, reducing latency and protecting privacy.
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
Newest first
Grab’s Android app cached runtime images with DiskLruCache, but its 100 MB size limit did not remove stale content while the cache remained below capacity, contributing substantially to device storage usage. The team developed Time-Aware Least Recently Used (TLRU), which combines LRU size eviction with time-based expiration using last_accessed metadata and a TTL, while a minimum cache-size threshold protects a baseline of cached images. TLRU retains the 100 MB maximum and evicts entries when current_time minus last_accessed exceeds the TTL; the implementation also supports reading existing LRU journal files by ignoring timestamp suffixes, enabling safe rollback. Configuration was tuned through experiments using cache hit ratio, with a maximum acceptable decline of three percentage points. After production rollout, P95 total app size fell approximately 50 MB, while hit ratio stayed within target and infrastructure costs did not increase.
Troubleshooting critical issues in the Grab app was hindered by incomplete user-journey data, because manually instrumenting hundreds of UI components left interaction gaps and delayed diagnosis. AutoTrack is a new SDK that records application state, user interactions, and UI screens in real time, creating an end-to-end session chronicle from launch through navigation. It tracks lifecycle transitions and launch mechanisms such as deeplinks and push notifications, while UIViewController, Activity, and Fragment lifecycle events identify the displayed screen. Screen metadata includes the full hierarchy as JSON; after personal information is redacted for GDPR/PDPA compliance, that data is used to train an AI model that generates an HTML representation of the screen and interactions. AutoTrack supports reproducing elusive bugs, automated issue assignment, UI test generation, and analytics-trigger validation, with future work adding network and performance signals, privacy guardrails, and automated triage.
MediaTek’s diverse NPU hardware and specialized compilation requirements have made on-device AI deployment difficult, especially for sophisticated generative models. The LiteRT NeuroPilot Accelerator, described as a ground-up successor to the TFLite NeuroPilot delegate, provides a unified API over MediaTek NPUs and supports both offline Ahead-of-Time (AOT) and on-device compilation. Its workflow can compile models for target SoCs, package Android assets and runtimes for Google Play’s Play for On-device AI, and invoke NPU inference through LiteRT with GPU or CPU fallback options. A new C++ API and Native Hardware Buffer Interoperability enable zero-copy transfers from AHardwareBuffer and OpenGL/OpenCL buffers, supporting real-time camera and video pipelines. On supported MediaTek chipsets, listed Gemma and Qwen models receive NPU-specific optimizations; the post reports up to 12x CPU and 10x GPU acceleration, including over 1600 tokens/sec prefill and 28 tokens/sec decode for Gemma 3n E2B.
Web-based POS systems can reuse ecommerce infrastructure for showroom-floor selling, but mobile readers such as the Stripe M2 and Tap to Pay cannot be accessed directly by a mobile browser. The proposed wrapper app avoids a complete native POS rebuild by embedding the site in a React Native WebView and connecting a mobile or Tap to Pay reader through the Stripe Terminal React Native SDK. A bridge message carries cart information, such as a cart ID and ready-to-pay status, to a ReaderManager that retrieves the amount and calls createPaymentIntent(), collectPaymentMethod(), and confirmPaymentIntent(). Payment results can return to the POS through a backend webhook and WebSocket or frontend polling, while security requires origin-checked messages, nonces, and server-side validation. The approach retains WebView performance, offline, native-access, debugging, and security limitations.
Migrating the Medium Android app from Apollo Kotlin 3 to 4 exposed cache and exception-handling issues that were hidden by the earlier implementation. Apollo Kotlin 4 uses a new group, plugin, and package identifier, places exceptions in ApolloResponse, and replaces ApolloCompositeException with a primary exception plus suppressed failures. CacheMissException errors appeared in watch() because programmatic cache IDs were incomplete or incorrect; the app addressed this with declarative type and field policies, __typename on every operation, cache-update helpers, and policy-aware safeWatch filtering. The migration also replaced executeV3(), removed fetchThrows = true, added a Currency scalar adapter, and identified HTTP batching and persisted queries as future improvements, while concluding that Apollo 4 produced a more robust cache integration after the underlying issues were fixed.
The post presents a gym membership access system that replaces plastic cards, fobs, and physical keys with Apple Wallet and Google Wallet passes scanned by an NFC reader. It uses Stripe Checkout and subscriptions for payment, PassNinja as a single API layer for issuing passes, and a DotOrigin VTAP100 connected to a Raspberry Pi Zero 2W, relay, and door strike for entry control. After Checkout, the website verifies that the Stripe subscription is active, creates a pass whose nfc-message contains the Stripe subscription ID, and redirects the member to add it to a wallet. A Linux gate process reads that identifier from the reader's virtual serial port, retrieves the subscription from Stripe, and activates the relay for five seconds when the status is active; otherwise it denies access.
React Native WebGPU and React Native Skia are presented as a graphics stack for advanced 2D, 3D, and general-purpose GPU workloads in native applications. The work uses Skia Graphite with Dawn, Google’s open-source WebGPU implementation, to replace separate OpenGL and Metal backend implementations with a unified architecture, while enabling Three.js, React Three Fiber, TensorFlow.js, and compute shaders. Three.js Shading Language lets the same shaders target WebGPU and WebGL, and Shopify’s Black Friday globe prototypes run natively with identical results to the web version. Architectural changes in React Native Skia moved from a mutable SkiaDOM to an immutable fabric reconciler, producing reported animation gains of up to 50% on iOS and nearly 200% on Android, plus 98% of reported Android crashes fixed. Graphite remains experimental, but adds dedicated-thread canvases and bidirectional 2D/3D composition, while Skia also supports macOS, tvOS, and headless Node.js rendering.
Sohail Pathan describes his path from Android development to a Senior Developer Advocate role at Okta, tracing how curiosity about technology grew into community and developer relations work. After studying Computer Science and adopting Kotlin for Android app projects, he moved from an EdTech startup’s Android team into its first Developer Community Manager role, organizing meetups, answering forum questions, and supporting learners. At a deeptech startup, he led Developer Relations for a cloud-based Android Studio tool, using meetups, hackathons, and feedback to seek product-market fit before technical roadblocks and limited demand forced closure after four months. At ApyHub, he created Go and Node.js tutorials, sample apps, API documentation, and community programs while gaining hands-on experience with REST architecture, microservices, API gateways, containers, load balancing, DevOps, OAuth, and identity management. He says that exposure led him to Okta, where he plans to share API and identity knowledge with its community.
Stripe’s Sessions 2025 developer track recap presents new products, APIs, and enhancements for building and managing financial infrastructure. Stripe’s Workflows provides visual automation for real-time events, with more than 600 triggers, branching logic, dynamic fields, and built-in error handling, while the MCP server and agent toolkit connect AI tools and agents to Stripe documentation, account data, APIs, and financial capabilities. Accounts v2 unifies connected-account management, and fully localized Connect Mobile Embedded Components bring onboarding to iOS and Android; the Payment Element also gains support for the Checkout Sessions API. New Stripe Apps UI components, generally available Sandboxes, Organization-wide sharing of customers and payment methods, and conversational documentation extend customization, testing, and collaboration.
Shopify’s mobile app has about 600 screens, but building every non-critical screen natively or in React Native was costly and slowed development, while conventional WebViews felt slow, disconnected, and out of place. Mobile Bridge addresses this hybrid-app problem with native iOS and Android modules that preload, authenticate, cache, and reuse WebViews, reducing P75 load time from 6 seconds to 1.4 seconds, including network latency and rendering. Built on @remote-ui/rpc, the framework uses JavaScript, CSS, Polaris overrides, title and action APIs, TransportableView, snapshots, and native modal transitions to preserve state and align web screens with native navigation and appearance. WebViews can also invoke native features such as date pickers, barcode scanning, and Add to Wallet; Shopify says the standalone library is being adopted across other products while critical features remain native or React Native.
Etsy adopted Jetpack Compose as its preferred way to build Android app UIs, after a staged program that culminated in rewriting the Shop screen. Because UI toolkits are central to development, engineers created a curriculum, rebuilt internal design-system components, and used Compose’s interoperability with XML Views to migrate gradually. They then tested a full internal screen with navigation, system UI, coroutines for API data fetching, and Kotlin Flows supporting unidirectional data flow alongside Macramé. After Compose bottom sheets reached real buyers and sellers, the Shop rewrite took about three months and entered an A/B experiment against the old implementation. The new screen improved initial rendering time by 5%, made interactions more fluid, and improved several user actions, while engineers reported fewer lines of code, easier testing, greater business-logic coverage, and higher satisfaction.
Shopify reviews five years of using React Native (RN) as its mobile strategy, adopted to avoid duplicating features across iOS and Android, improve talent portability, and ship more value. Over that period, all of its apps migrated to RN through team-led, non-uniform plans, while native code remained part of the architecture rather than an alternative to eliminate. The company reports sub-500ms P75 screen loads in the Shopify app, similar performance across its apps, and more than 99.9% crash-free sessions, while noting that performance depends on applying sound patterns. Its experience credits hot reloading and TypeScript with developer productivity and cross-platform staffing, but identifies debugging, RN upgrades, and third-party dependency maintenance as costs. Shopify now emphasizes shared libraries, native expertise for platform-specific work, continued New Architecture adoption, and collaboration with the RN ecosystem.
Grab designed an equivalent to iOS Live Activities for Android to provide real-time order tracking outside the app. Because Android lacks Apple's native ActivityKit push token system, the team substituted push tokens with placeholder values to maintain technical consistency across platforms and preserve backend push targeting via their Hedwig service. For the user interface, engineering selected custom notifications over floating views because custom notifications avoid intrusive screen usage and do not require the 'Draw over other apps' permission. The client implementation separates responsibilities across dedicated classes: LiveActivityIntegrationManager handles token registration across business verticals, LiveActivityAttributes encapsulates UI configuration, and LiveActivityManager maps payloads to Android NotificationManager instances. The solution launched for Food, Mart, Express, and Transport verticals.
Shopify built Tophat to reduce the time and friction involved in manually testing mobile pull requests, where switching branches, stashing changes, and waiting for Xcode or Android Studio builds slowed review. The macOS menu-bar application links GitHub pull requests to iOS and Android artifacts produced by CI and stored in Google Cloud Storage, allowing contributors to install builds on simulators or real devices with one click. Tophat parallelizes tasks such as downloading applications and booting devices, and its Quick Launch feature retrieves builds with up-to-date native code for React Native development. The project also addressed real-device iOS installation and signing challenges, integrated with Shipit Mobile, and provided automated setup guidance. After the latest improvements, daily usage doubled, and Tophat was later made open source.
eBay’s Product Research, formerly called Terapeak, brings three years of sold-items data into its mobile app so sellers can research products and create listings from anywhere. The service reports actual sold prices, including accepted Best Offer prices, along with average and range, free-shipping share, average shipping cost, and the number of sellers who sold a product. Sellers can search, sort, filter, inspect a price-trend graph, and use “Sell one like this” to start a listing pre-populated from a sold listing. Product Research is available in the latest eBay app for iOS and Android, while desktop sellers can use it through Seller Hub; planned additions include sell-through rate, more trend graphs, and active-listing views.
The Etsy Android listing screen had accumulated nearly 200 experiments in three years, leaving a 4,000-plus-line Fragment, inconsistent patterns, low test coverage, and costly, brittle tests. Macramé replaced that legacy design with immutable state propagated through StateFlow to a reactive UI, transforming screen data into smaller ListingUiModels rendered by RecyclerView and ListAdapter. Sealed Events move through a single Dispatcher to focused Handlers, which update State, start asynchronous work, or emit SideEffects for operations such as navigation and logging. After a five-month rewrite, the new screen’s Time to First Content fell 18%, from 1,585 ms to 1,298 ms, while listings viewed rose 2.4% and business-logic test coverage reached 76%. The architecture still has wiring boilerplate, debugging challenges around Handler interactions, and possible overkill for simpler screens, but its use expanded to Cart and Shop.
Grab launched Project Bonsai to optimize the size of its Android superapp, which encompassed over four million lines of code across 1,500 modules. Because large app sizes negatively impact user acquisition on low-end devices with constrained bandwidth, the engineering team structured its optimization strategy around measurement, reduction, and containment. The team developed App Sizer, a custom CI-integrated tool that tracks binary compositions and module size contributions in Grafana. Initial reductions targeted Java and Kotlin dex files, resolving bloated transitive R classes by upgrading the Android Gradle Plugin to eliminate overly broad R8 retention rules. These initiatives achieved a 26% reduction in app download size while simultaneously decreasing overall disk footprint.
React Native Skia exposes Google’s cross-platform Skia 2D graphics engine to React Native, giving developers a canvas for custom shapes, visual effects, and dynamic interactions. The article explains when to choose it over react-native-svg or standard React Native Views: SVG is optimized for static SVGs, while Skia supplies primitives such as shaders, path operations, and image filters for animated experiences. It introduces the Cartesian canvas, basic Circle, Rect, and RoundedRect shapes, and custom paths created with SVG notation or imperative commands including addCircle, lineTo, and addPoly. Examples then combine Skia with react-native-reanimated shared values for UI-thread animation and react-native-gesture-handler for panning, before adding Blur and DashPathEffect; the article also notes web support through React Native Web and points to further examples.
Supabase’s July 2023 update lists product releases, community content, and preparations for Launch Week 8, which was scheduled to begin the following week. The shipped changes include a new Android Kotlin client library, Login with Figma as an OAuth provider, Resend support as a custom SMTP provider, pgsodium 3.1.8, and PostgREST 11.1. A performance benchmark examines pgvector 0.4.0’s strengths and limitations, while noting that work on HNSW had started and was not far away. The update also features a Snowflake natural-language query application built with Python, Streamlit, Open AI, and Supabase Vector, plus tutorials, courses, community projects, and hiring announcements.
This tutorial shows how to add Google authentication to a cross-platform Flutter application using the Supabase SDK for Flutter. It explains OpenID Connect as a protocol built on OAuth 2.0, then configures Google Cloud client IDs for iOS, Android, and web, with Supabase using the web client ID to verify the supplied identity token. The sample initializes Supabase, starts Google sign-in through google_sign_in, passes the resulting access and ID tokens to signInWithIdToken, and listens for signed-in events to navigate from LoginScreen to ProfileScreen. The profile reads avatar_url and full_name from Supabase userMetadata, while a sign-out action returns the user to the login screen, producing a basic personalized app.
The best engineering reads, once a week.