arXiv preprint ·
Hardware-Aware Conditional Code in Android Apps
- Published
- Source
- arXiv preprint, posted before peer review
- Original
- Read it at arXiv
- Topics
Abstract
Android OS runs on a highly diverse set of devices, spanning entry-level phones and flagships with substantially different hardware characteristics, including memory capacity, processors, displays, cameras, and sensors. Through APIs, apps can query device information at runtime, such as memory, hardware features, and manufacturer, among other device properties, allowing developers to execute different code paths on different devices. Existing studies cover only specific compatibility bugs or brand-specific behavior; however, the broader use of hardware information in app logic has not been comprehensively explored. We address this question with a large-scale empirical study of hardware-related if statements in Android apps. We statically analyze 50,000 apps to identify the if statements whose conditions depend on the values of hardware-related APIs, and extract their conditions together with the code of their branches. Our results show that 95% of successfully analyzed apps contain at least one such statement, with an average of 74 per app, which suggests that hardware-related logic is widespread. We then apply an LLM-assisted open-coding process to the extracted code to build a structured taxonomy of the purposes behind hardware-related conditional code. The resulting characterization shows that developers use hardware information for feature availability checks, UI adaptation, emulator detection, device tiering, and resource management, among others.
The authors’ abstract, as arXiv lists it. arXiv’s listings, abstracts included, are free for anyone to reuse.
Read it on ReadSearch
Each opens after you create an account, and brings you back to this paper.
More in Software Engineering
AIFaultBench: A Reproducible Benchmark of Real-World Faults in AI Software Systems
DERED: Enhancing Third-Party Library Detection in Binaries via Deceptive Reuse Mitigation
RepGen: Reproducing Deep Learning Bugs through Context-Aware Code Generation and Verification
AgentPRO: Coordinating Compiler Optimizations for LLM Agent Workflows
One Verdict Is Not Enough: Regression Testing Learned World Models and Their Test Harnesses
Get the few papers worth your time in Software Engineering every morning.
ReadSearch reads the new papers in your field each day and brings you the few worth reading, each with its key finding in a sentence.