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 passenger Android superapp relies on more than 170 in-house and open-source libraries, incorporating five to ten library bumps into each weekly release. Although developers often avoided updates due to the fear of leaking defects or crashes into production, the engineering team established a risk-assessment framework based on codebase usage and the volume of incoming changes. To minimize update diffs and avoid accumulating large issues, libraries are updated incrementally on a weekly cadence matching upstream release schedules. Automated UI test cases written in Gherkin syntax execute on CI for every merge request, while high-risk bumps trigger targeted QA manual testing. This structured updating process prevents defect leakage while keeping the application compliant with evolving Google Play target API requirements.
Size.link is a free Shopify AR tool that lets shoppers view a product’s dimensions in their surroundings through a smartphone camera. It was created during April Hack Days as a quick alternative to commissioning 3D models, with requirements including browser-based operation, speed, accuracy, and iOS and Android support. Because iOS lacks JavaScript WebAR, the implementation uses AR Quick Look with USDZ files and Android’s Scene Viewer with GLB files. Rather than generate files dynamically with slow USDZ tooling or pre-generate billions of dimension combinations, the team modifies binary template data, replacing scale or vertex float values to resize the cube while preserving its outline. The resulting Ruby server generates USDZ files in well under one millisecond, and the same strategy produces GLB files; future work could add textures for standard-sized products.
Android Vitals data revealed that 15.7% of Grab users had less than 1GB of free device storage and uninstalled the app at 1.2 times the normal rate. To understand on-device storage consumption, the team instrumented session launches using the Android StorageManager API to collect binary size, cache folder size, and total footprint metrics. Analysis showed unusually large cache sizes driven by orphaned cache folders from discontinued third-party libraries, including an image library replacement of Picasso by Glide. An automated cleanup routine deployed in app updates purged legacy cache directories upon launch. This mechanism reclaimed 575 terabytes of junk data across more than 13 million devices, averaging 40MB per user.
React Native’s standard native-module documentation does not explain how to reuse an existing native container while rendering React Native views inside it. This Android-focused Kotlin guide builds a native bottom-sheet component with a ViewGroupManager, inflating a CoordinatorLayout XML layout whose second child becomes the draggable sheet content. It overrides addView to place the first React Native child in the main container and subsequent content in the bottom sheet, then exposes the component through TypeScript with style and children props. A sheetState prop accepts collapsed or expanded, while BottomSheetBehaviour emits a BottomSheetStateChange event so native gestures update React state. The guide concludes that ViewGroupManager enables flexible React Native layouts around native functionality, while noting that platform parity remains important.
Grab released Grab-Posisi, a GPS trajectory dataset covering Singapore and Jakarta designed to overcome the poor coverage, low sampling rates, and missing contextual metadata common in existing public datasets. Captured in April 2019 from drivers in transit, the dataset comprises 84,000 trajectories, over 80 million GPS pings, and more than 1 million kilometres recorded at a one-second sampling frequency. Each entry in the 2 GB Apache Parquet dataset records geographic coordinates, timestamp, accuracy radius, bearing, speed, mobile operating system, and vehicle mode. To protect privacy, driver personal information is encrypted and trip start and end locations are removed. The data enables applications including automated road network reconstruction, map matching, real-time traffic forecasting, and municipal infrastructure planning.
Shopify is moving forward with React Native for new mobile apps after years of native development, driven by mobile purchasing volumes and a desire to consolidate iOS and Android work. It describes React Native as a framework that uses JavaScript and React’s declarative model to translate virtual DOM structures into native platform views through native bindings. Experiments with Arrive, Point of Sale, and Compass reported twice the productivity on Arrive, an estimated 80% code sharing target, and observed sharing of 95% for Arrive and 99% for Compass, while testing lowered the considered Android CPU threshold from 2GHz to 1.5GHz. The policy does not require rewriting existing native apps, leaves low-level libraries native and native hiring in place, and calls for dedicated React Native tooling, foundations, and open-source partnerships.
Grab undertook an initiative to reduce startup time and improve time to interactive (TTI) on its passenger mobile app. Because local benchmarks failed to simulate real device and network conditions, the team instrumented code in production across 8–9 million daily users to capture p50 and p95 metrics. Initial gains came from caching service tiles between sessions and removing a startup animation, saving four seconds. Architectural changes followed, including converting iOS dynamic frameworks to static linking and merging others, while Android initialisation was refactored with Kotlin coroutines. Replacing a heavy third-party analytics library with an internal experimentation platform yielded further startup reductions.
Designing digital products for Southeast Asia requires tailoring user experiences to unique regional constraints and consumer behaviors across diverse populations. Users in the region often operate low-end mobile hardware on congested networks while carefully rationing prepaid mobile data. Grab addresses these challenges by designing comprehensively for non-ideal UI stacks, implementing loading skeletons, and replacing heavy video tutorials with lightweight SVG animations to minimize bandwidth consumption. Furthermore, product teams adapt to mobile-only environments by prioritizing phone number and one-time-password registrations while avoiding legacy desktop-era iconography. Visual accessibility is validated by testing UI readability on dimmed, low-resolution screens under bright ambient sunlight.
Shopify’s Android POS lacked printed-receipt support until March 2019, leaving merchants who needed it to use iPads. The design targets a pragmatic, adaptive, composable, maintainable, and highly testable API, while handling more than 8 billion possible receipt content combinations across discounts, tips, transactions, gift cards, refunds, payment methods, and regional requirements. Its six-step pipeline aggregates models from SQLite or GraphQL, transforms them into a PrintableReceipt, defines view-based sections, creates printer-agnostic PrintRequest objects, renders section bitmaps at the required resolution, and passes them through the Hardware SDK to vendor-specific integrations. The PrintableReceiptComposer contains most business logic, with unit tests covering features and edge cases, while screenshot tests compare rendered output pixel by pixel in CI. This componentized separation isolates printer support from receipt generation and allows new printer models to be added in a couple of hours.
Following the release of the GrabPay Merchant App, Grab adopted React Native inside the Grab Passenger app to maintain a single cross-platform codebase across iOS and Android. Integrating the framework into native applications required establishing bridge communication guidelines and incorporating React Native modules into the Grablet architecture. To streamline network communication, API calls were migrated from axios to native bridges returning promises, which eliminated the need to pass access tokens into JavaScript. The team also established a shared internal library of approximately 20 UI components alongside Redux for state management and react-navigation for routing. Modules like BillPay and Transaction History successfully launched across Southeast Asia while maintaining the performance and feel of native software.
Shopify built Shipit Mobile to replace error-prone, manual mobile app releases with a shared platform for creating, viewing, and managing releases. The process creates a release branch from master, builds a candidate for each commit, increments build numbers, and starts separate CI pipelines for testing and release builds. Shipit Mobile uploads the same binary and metadata to distribution channels including Google Play, the App Store, and internal support access, using store APIs and Fastlane, while Slack notifications make release status visible beyond the release captain. Developers can bypass CI when necessary for emergencies, and configuration favors convention over configuration for project metadata. After more than six months in production, the platform reduced release complexity, shortened the release cadence from three weeks to one week, and helped more people become release captains.
Shopify’s “Build Things, Show Shopify” initiative used app development to reach local mobile developers beyond traditional recruitment channels and strengthen its talent pipeline. From May to August, workshops in Ottawa supported 75+ participants with help from more than 20 Shopify product managers, developers, designers, and computing educators, covering workflows, coding, code reviews, design, and presentation skills. At the September showcase, 13 developers presented 12 apps through rapid three-minute rotations, after which six promising projects advanced to a grand panel of Shopify leaders who provided technical questions and feedback. Participants left with fully developed apps, while a later Ottawa showcase connected them with angel investors and technical recruiters. The initiative also exposed a retention and inclusion problem: participation fell from 24 women among 77 at launch to 16 at the last event, with only two reaching the showcase, prompting consideration of daytime workshops.
Shopify’s Android Point of Sale app adopted Model-View-ViewModel (MVVM) to replace an inconsistent codebase containing both MVC and MVP. Because the roughly three-and-a-half-year-old app could not be migrated at once, the team used MVVM for all new screens and converted legacy screens during significant changes. In the architecture, Fragments and sub-views report UI actions through contracts, ViewModels fetch and mutate data, and LiveData delivers updates to active observers. ViewModelProvider retains ViewModel instances across Activity or Fragment configuration changes, while Models handle databases, networks, and caches. Shopify reports more consistent development, easier onboarding and testing, lifecycle-safe UI updates, and a codebase that is easier to modify, although some MVC and MVP screens remain.
Shopify requires developers to test features because it has no QA team, and its manual “tophatting” means running changes locally before merge. Mobile tophatting was slow because switching branches could invalidate Xcode/Android Studio caches, with builds taking up to 15 minutes. The new process skips compilation by exporting CI-built iOS and Android binaries into disposable PR environments, exposing them through the CI API and GitHub commit statuses, then extending the dev command to authenticate, find and filter artifacts, select an app and simulator or emulator, install it, and launch it. Developers can target pull requests, repositories, branches, or build URLs, while iOS apps are zipped .app folders and Android apps retain APK names. The team reports a positive response and lists local artifact caching, real-device support, and simpler commit or branch inputs as improvements.
Open-source Android applications must remain buildable for contributors without exposing the credentials used by third-party services. Kickstarter’s Android application added Crashlytics through Fabric for crash reporting and real-time analytics, but integrating it required protecting the Fabric API key and secret from public source control. The post presents two normal SDK configuration paths—manifest metadata or fabric.properties—then uses a generated properties file, an example fallback, and Gradle logic to supply values from environment variables when available. Contributors without access to the secret repository receive an example apiKey value of 0, allowing the Fabric SDK to compile without the invalid null-key error, while the project’s real credentials remain outside the open-source codebase.
Shopify created Android Bootcamp to address its need for mobile talent while giving local developers an entry point into Android development. The two-day workshop targeted people with at least one year of development experience, especially newcomers to Canada, and taught participants to build a simple quiz app. The curriculum covered XML-defined views, Android lifecycles, MVC, JSON parsing, libraries, and remote data fetching, with six Shopify mentors supporting one primary teacher. After screening 33 applications, the team accepted 14 people—seven men and seven women—and received positive feedback, although participants found the room too small. Shopify reported 100% overall happiness, one attendee later joined full-time, another was set to join in May, and a second bootcamp was being planned for June.
Kickstarter’s open-source iOS and Android apps use Functional Reactive Programming (FRP) patterns to keep views simple and move mutation and complex logic into thoroughly tested ViewModels. The post describes how this discipline helped a developer ramp up quickly on the Android codebase after working on Kickstarter’s backend and payments teams. It also introduces the Android team’s interest in Kotlin, a JetBrains language that runs on the JVM, while noting that dependency concerns had prevented conversion of core functionality. For a 2017 Functional Swift Conference talk in Berlin, the author used Kotlin to add a simple Android screen following the team’s established FRP patterns, presenting the implementation as live coding and an introduction to FRP and Kotlin.
Grab announced its first Grab Vietnam Careers Week, held in Ho Chi Minh City from 22 to 26 October 2016, aimed at hiring engineers to improve regional transportation and reduce congestion. At the time, Grab operated on 23 million mobile devices supported by 460,000 drivers across Southeast Asia. The announcement features an interview with Singapore-based iOS engineer Hai Pham and Android engineer Son Nguyen discussing team culture, regular hackathons termed "Grabathons", and relocation to Singapore. Technical candidates undergo a Codility test and are evaluated on clean mobile architecture, testing, and performance maintenance. The engineers also offer advice on apartment hunting through online community forums and adapting to life in Singapore.
The best engineering reads, once a week.