Reviving a 2014 Samsung Galaxy S5 to run CoGo’s full Android build toolchain

I recently went looking for the oldest phone in my junk drawer to answer a question I’m curious about: what’s the oldest device that will actually run Code on the Go (CoGo™)? The answer turned out to be a much older phone than I expected, as long as I was willing to install a custom ROM. 

(A quick note about the images: All screen shots are real and were captured on the S5. The phone “frame” on all of them is a separate graphic.)

The starting point

My oldest phone is a Samsung Galaxy S5 (SM-G900T, codename klte), released in 2014. Its stock firmware tops out at Android 6.0.1 (Marshmallow), and CoGo requires at least Android 9. But the hardware wasn’t the limiting factor; the OS was the problem. So, I started looking for ways to change the OS.

How I did it

I’m not a skilled ROM hacker (or a hacker of any kind). In fact, I’ve only done this once before, also on a Samsung S5, around 2016. (The phone didn’t unlock all the supported LTE bands for my carrier, which created a dead zone on my commute. I faithfully followed Reddit instructions to fix it using Odin, and never thought about it again until now.)

Updating klte is well documented, which made this a fairly straightforward process. I didn’t have to learn about partitions or bootloaders, and I only needed to download three things:

  • Odin: Samsung’s proprietary flashing tool pushes a custom recovery onto the device over a USB connection in download mode. Odin is not officially released outside Samsung. Always do your homework on trusted mirrors before you download anything to your device. 
  • TWRP: The custom recovery that replaces stock recovery and provides access to full partition wipes and zip-based ROM installs.
  • LineageOS for klte: The ROM itself, built and maintained well past Samsung’s support for this hardware.

For this project, the general steps were:

  • Boot into download mode.
  • Use Odin to flash TWRP to the recovery partition.
  • Boot into TWRP.
  • Wipe data/cache.
  • Sideload LineageOS. The current klte build is Android 11, well above CoGo’s Android 9 minimum.

Installing 32-bit CoGo

This was my first opportunity to install the 32-bit CoGo build, since the next-oldest phone in my drawer is a 64-bit OnePlus 6T from 2018. Double-tapping the APK to install didn’t do anything, but long-pressing the APK and choosing to open it with Package Installer worked. I encountered no problems assigning required permissions or completing the full configuration process.

The actual test: a real Gradle build

CoGo doesn’t fake or cross-compile anything, and runs an actual Gradle daemon in a separate process on the device, using a real JDK and Android build tools provided by an embedded Termux environment. There’s no shortcut version of the build for weaker hardware, so the S5 would be doing the same compilation work as a modern flagship phone, just slower. So much slower.

Creating a new project from the Basic Activity template took noticeably longer to initialize than on modern hardware, which isn’t surprising, because the first-run Gradle/Kotlin tooling setup is CPU- and IO-heavy. The first build of the untouched template with no code changes took a grueling seven minutes. But! To my great delight, the S5 finally compiled, packaged, installed, and launched the app. 

The second initialization and build were both noticeably faster because of CoGo’s Gradle caching and process reuse. 

CoGo on the S5 successfully builds and installs an app

The easier case: accessing Knowledge to Go

App Dev for All is preparing to launch Knowledge to Go (K2Go™), which ports Internet-in-a-Box’s outstanding offline education services to Android. I wondered how the S5 would work as a K2Go client, so I tried accessing content hosted on a Pixel 7 running the K2Go server.

Because clients access K2GO in a browser, it’s a much lighter workload than running a build toolchain. The only minor obstacle was the S5’s camera, which doesn’t support scanning QR codes. I downloaded a compatible QR app from F-Droid, but K2Go also provides direct URLs if you can’t scan and need to connect by hand. I had no problems browsing and viewing content stored on the K2Go phone. 

Accessing Wiki Med on Knowledge to Go on an offline S5

The takeaway

Seven minutes to build a tiny Java project isn’t a benchmark to brag about, but it’s also not the point. What’s important is that a decade-old 32-bit ARM chip successfully ran CoGo’s full compiler toolchain end to end, and was a good client for accessing local K2Go resources. In fact, CoGo’s 32-bit build accounts for a little more than ten percent of all of our downloads, indicating that there’s a receptive audience for our tools.

Overall, my adventure down the ROM-flashing rabbit hole proves that even very old phones—including the billions of outdated phones living in junk drawers like mine—can still be useful beyond their worth as scrap. (Also, the experiment justifies my hoarding every working phone I come across, no matter how old or underpowered.)