Behind the app
How we built Flex Music Player
Flex Music Player is made by OrganiCode, a custom software company in Vereeniging, South Africa. It started with a music app whose adverts got in the way of everything, and whose playlists were a chore to manage. This is how we built the replacement.
Three priorities, in order
- Robustness. Playback never silently stops. The library, playlists and your place in a track are never lost or corrupted. No bad file, permission change or killed process breaks the app.
- Minimum resources. Battery, memory, processor time, storage and download size.
- Features. Only after the first two.
Whenever two of them pulled against each other, we wrote the decision down with the reason. That log ran to dozens of entries by launch.
The stack
- C# on .NET for Android, with no cross-platform UI framework: plain Android views, one activity, a dark theme and three bundled fonts.
- Google's Media3 ExoPlayer for playback, running as a proper media service, so the notification, lock screen, Bluetooth and headset buttons all work the Android way.
- SQLite for the library and playlists, written by hand with no ORM, and TagLibSharp to read song details from the files.
- A short, fixed list of dependencies. No analytics, crash-reporting or advertising libraries, and no internet permission.
"No internet" is checked by the build
Libraries can quietly add permissions to an app. Our release build reads the final Android manifest and fails if the internet permission shows up, so it can't slip in by accident. The finished app downloads at about 7.5 MB.
Tested where it matters
- The logic that decides what plays next, how the library merges after a scan, how shuffle deals and what happens after a failed track lives in its own platform-free library, covered by about 250 automated tests.
- We loaded a library of 10,000 tracks to check that scrolling, searching and scanning stay quick.
- We killed the app mid-song, on purpose, to check it comes back to the same song at the same spot.
Small things that keep your music safe
- A song can't end up in a playlist twice, because the database itself refuses the duplicate.
- Playlists are also saved to a backup file a few seconds after each change. If the database is ever damaged, the app sets it aside and rebuilds from your music and that backup.
- While music plays, your place is saved every 30 seconds. While it's paused, nothing runs at all.
- Shuffle draws a fresh, securely random order on every press, and never reuses an old one.
- A file that won't play is skipped, counted and flagged, so one broken song never stops a playlist.
Hearing a knock
Bump gestures read the phone's accelerometer about 200 times a second, filter out gravity and walking, and look for a sharp sideways jolt. Our first version sometimes picked the wrong side, because the first reading over the threshold was often the swing before the impact or the bounce after it. Now each knock is measured from start to finish and judged by its strongest moment. More about bump gestures.
Built on a Xiaomi
We developed and tested on a Xiaomi phone running HyperOS. Xiaomi phones are among the strictest about closing background apps, so the app has a Keep playing helper with a five-minute screen-off test for anyone whose phone does stop the music. The guide to those settings works for any music player.
Need an app built?
OrganiCode has built custom software for South African businesses since 2018, with the same care that went into this app. Talk to OrganiCode.