← Back to projects

work · ongoing

How I Build Android Apps for Thousands of Classroom Panels

Making Android apps work on 4K classroom screens: recordings that don't get lost, an app that opens faster, pens from different vendors, and hardware rules phones never have.

Android · Large screens · HardwareKotlin · Jetpack Compose · MediaCodec & MediaProjection · Perfetto & Macrobenchmark · Vendor ink SDKs

Role
Android engineer, whiteboard & classroom apps
Duration
Dec 2024 – present
Type
work
Status
ongoing

Key results

  • 94%Fewer lesson recordings lost per panel to crashes and kills, new recorder vs old
  • 2,430 ms →1,807 msTime for the whiteboard app to open, against the production build, measured on a panel (~25% faster)
  • ~4 min →2.4 sTime to save a two-hour lesson after pressing stop

Overview

Teachmint’s interactive flat panels are 4K Android displays at the front of a classroom. They’re switched on in the morning and used all day for a digital whiteboard, recorded lessons, video, an AI assistant and everything else a teacher puts on screen. In our fleet telemetry, almost every panel runs Android 16.

Since December 2024 I’ve worked on the apps those panels run: first the Teachmint classroom app, then the whiteboard and Edu AI, the AI assistant. This page is the overview. The individual projects have their own write-ups.

The problem

An Android panel looks like a big tablet. It isn’t, in ways that keep showing up in bugs:

  • Every frame is big. A full-screen view at 3840×2160 is 8.3 megapixels of measure, layout and draw. A hidden-but-visible layer that costs nothing on a phone costs real time here.
  • Ink doesn’t go through Android. On these panels, pen strokes are drawn by vendor SDKs onto hardware planes composited after SurfaceFlinger. Ink doesn’t appear in screenrecord, so debugging it needs a camera.
  • Boot is when everyone arrives. More than half of whiteboard cold starts happen within two minutes of the panel booting, while every other service is starting too.
  • The firmware isn’t ours. Panels come from several OEMs, each with its own system properties, signing keys, permission rules and vendor SDKs. Apps ship preinstalled, as system or privileged apps, often outside Play.
  • The data can’t be recreated. A lesson recording or a board a teacher wrote on for an hour is the only copy.

Constraints

  • One codebase across OEM flavours, without vendor code leaking into the wrong build.
  • Fixes verified on real panels, because emulators don’t run the vendor ink stack, the OEM permission rules or the startup paths that matter.
  • No reliance on Play for delivery, profiles or vitals across the whole fleet.

My approach

The work falls into a few threads:

  1. Recording that survives. I led a rewrite of the whiteboard’s screen recorder into five-minute segments, each a complete MP4. A crash now costs at most one segment. A container-level stitcher joins a long lesson in seconds instead of minutes, with a validator in front and the old path behind it.
  2. Startup on 4K. I traced cold start from fleet telemetry to Perfetto. The work deferred a WebView, ML Kit and icon decoding until after the first frame, stopped hidden compose layers from composing, and added a Baseline Profile generated on a panel.
  3. Vendor hardware. I integrated pen acceleration through OEM writing SDKs, chased bugs where the SDK reported healthy while drawing nothing, and kept vendor code scoped to the flavour that needs it.
  4. System-app plumbing. This covered an OTA SDK for preinstalled apps, a PKCE-based sign-in broker between apps, and overlays that live by window-manager and accessibility rules.
  5. Offline features. I built search over NCERT lesson content that works with no network, after measuring that the ROM’s SQLite doesn’t include FTS5.

Important decisions

Measure on the panel, not the emulator

Several conclusions flipped once measured on real hardware:

  • An emulator-generated Baseline Profile missed thousands of rules for panel-only code paths, and its timings were too noisy to A/B.
  • Debug builds were about 4.5× slower to start than release-like ones.
  • Play Console’s startup vitals turned out to describe a different firmware population from our own telemetry.

Fail closed, keep the old path

Every risky fast path, such as box-level MP4 concatenation or silent self-update, has a validated slower path behind it and reports which path ran. On devices we can’t touch, a wrong answer costs far more than a slow one.

Keep OEM differences behind interfaces

Serial numbers, ink acceleration and install permissions differ per OEM. Each lives behind an interface with a per-flavour implementation, so a panel’s APK contains only its own vendor’s code.

What went wrong: a profile photo that killed the recording

Teachers who had uploaded an iPhone profile photo lost their class recordings. Anything that recomposed the toolbar’s avatar chip, most visibly a toolbar switch, ended the recording within two seconds.

The photo was HEIC. Android decodes HEIC through the HEVC video decoder, and on these RK3576 panels, allocating the hardware HEVC decoder while the recording’s hardware AVC encoder was running crashed the vendor codec HAL. Both codec components died, and the recorder’s drain loop with them. It reproduced 3 times out of 3.

The fix was at the edge, not in the recorder. Avatars are transcoded once to a cached JPEG and never decoded while a recording is live. The chip shows initials until recording stops. The general lesson: on shared hardware, an image decode is a codec allocation.

Debugging & Investigation

The tools that paid for themselves:

  • Fleet telemetry joined per recording or per launch, deduplicated by session, with collision-free device keys. Raw event counts misled us more than once.
  • Perfetto with our own trace sections, on release-like builds only.
  • Downloading the actual artefact. For a “black” lecture recording, parsing the uploaded MP4 and decoding its frames cleared the stitcher and pointed at the capture.
  • A phone camera. Ink on a hardware plane is invisible to every software capture.

Result

  • Recordings lost to crashes and kills fell by 94% per panel over the same four weeks, comparing the old engine with the new one, and a 113-minute lecture stitched in 2.4 seconds in production.
  • Cold start to first frame on a TeachmintX 75 Pro went from 2,430 ms on the production build to 1,807 ms with our Baseline Profile, about 620 ms (25%) faster, measured on the panel.
  • Edu AI ships on four OEM panel flavours in twelve languages from one codebase.

What I learned

  1. Scale changes the cost model. On a 4K panel, a layer you can’t see still costs a full-screen frame.
  2. Hardware you don’t own needs evidence, not assumptions. Vendor status codes, permission rules and codec HALs all behaved differently from their documentation, or from how we read it.
  3. Make every intermediate state valid. Segments, sidecars and validate-before-promote prevented more data loss than any single fix.
  4. Check what your dashboards are counting. Two correct dashboards can disagree because they see different fleets.