getactivity/devicecompat — explained in plain English
Analysis updated 2026-07-21 · repo last pushed 2026-02-11
Apply targeted bug fixes for a specific phone system like MIUI or OneUI.
Show different permission-request instructions depending on the detected OS.
Adjust app behavior for Huawei HarmonyOS versus Xiaomi HyperOS.
Check the device OS type and version with a single line of code.
| getactivity/devicecompat | peng-zhihui/bluetoothtouch | szili1994/create-aeronautics-minecraft-mod | |
|---|---|---|---|
| Stars | 513 | 533 | 292 |
| Language | Java | Java | Java |
| Last pushed | 2026-02-11 | 2021-07-09 | — |
| Maintenance | Maintained | Dormant | — |
| Setup difficulty | easy | moderate | moderate |
| Complexity | 2/5 | 2/5 | 2/5 |
| Audience | developer | general | general |
Figures from each repo's GitHub metadata at analysis time.
Drop-in Android library with no external dependencies or infra required.
DeviceCompat is a tool for Android app developers that solves a surprisingly tricky problem: figuring out not just what brand of phone someone is using, but what customized operating system is running on it. If your app needs to behave differently on Xiaomi's HyperOS versus Huawei's HarmonyOS, this library tells you exactly what system is in front of you. The core issue it addresses is that checking a phone's brand is unreliable. Someone might own a Xiaomi phone but have replaced its operating system with a different version. Existing tools only check the manufacturer, which leads to incorrect assumptions. This project goes deeper by detecting the actual system software, covering a wide range of platforms including MIUI, ColorOS, OriginOS, MagicOS, OneUI, and many others. Developers can use a single line of code to check the system type, get the system version, or identify the device brand. An Android developer building an app for a wide audience would use this when they need to apply specific fixes or features for certain phone systems. For example, permission-handling can vary significantly between manufacturers, and an app might need to show different instructions or take a different approach on a Samsung device versus an OPPO device. This tool makes those targeted adjustments much more dependable. It is also notably lightweight at just 21 KB, so it will not bloat the app's file size, and it works on any device running Android 4.0 or later. The creator notes this was a difficult project to build and release as open source, not because of complex algorithms, but because it requires tedious testing across thousands of phone models. The accuracy depends heavily on collecting real device data, and the author actively asks the community to contribute system information from their own phones to improve detection precision over time.
A tiny Android library that detects which customized phone operating system is running, like MIUI, HyperOS, or HarmonyOS, so your app can adapt its behavior per device instead of guessing from the brand name alone.
Mainly Java. The stack also includes Java, Android SDK.
Maintained — commit in last 6 months (last push 2026-02-11).
The license is not specified in the project materials, so usage terms are unclear.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.