Project Overview
This project involved developing a Standalone Android Application designed to automate and measure battery consumption and network performance on smartphones. The solution forms part of a Device Under Test (DUT) framework, where real-time current draw is recorded using external lab hardware during automated usage scenarios. This setup ensures repeatable test conditions under real-world activity simulations, eliminating the need for manual testing and human intervention.
Industry
Mobile Technology / Telecom Testing
Challenges Addressed
One of the biggest challenges faced was Android's restriction on programmatic control of external third-party apps. These limitations affected network prioritisation and automated call handling on newer Android versions, particularly from version 13 onwards. Additionally, early prototypes that used foreground services to maintain task activity led to increased battery drain and CPU usage. Furthermore, even though Android provides APIs like ConnectivityManager.bindProcessToNetwork for managing network bearer selection, the enforcement was only partially effective, especially when Wi-Fi remained enabled and dominant over cellular data. These issues presented significant roadblocks to building a reliable, automated, and power-efficient test solution.
Collaboration in Action
Cubet collaborated closely with the client to address these technical challenges by iterating through several testing models. The focus was on achieving precise measurements, strict timing accuracy, and high repeatability across multiple Android OS versions. By replacing continuous foreground services with event-driven timers, Cubet ensured devices could enter deep sleep between tests, conserving battery life. The integration of realistic, in-app simulations for video streaming and web browsing allowed Cubet to bypass restrictions on controlling external apps while preserving test integrity. Working hand-in-hand with the client’s engineering and QA teams, we refined the modular architecture to allow better control over test sequences and to reduce system load during extended test cycles.
Technologies Deployed
To ensure both technical depth and power efficiency, several advanced Android technologies and APIs were implemented:
- AlarmManager.setExactAndAllowWhileIdle() was used to schedule tasks during idle periods without affecting deep sleep states.
- WebView was used to simulate real-world browsing activities in a controlled and repeatable manner.
- ExoPlayer, an efficient and lightweight media player, was integrated to simulate video playback and streaming usage.
- ConnectivityManager.bindProcessToNetwork allowed limited control over switching between Wi-Fi and cellular networks as per test requirements.
- A dedicated File Transfer App was developed for isolated file uploads and downloads to avoid interference from other processes.
Innovative Features
The application featured a configurable, modular testing framework that could simulate a variety of user activities such as calling, idling, video playback, file transfers, and browsing. Test Sequences could be adjusted based on specific scenarios, providing flexibility and control. The transition between network bearers was managed internally, ensuring that each test accurately reflected either a Wi-Fi or Cellular environment.
Another innovation was the adoption of an event-driven model using timers, which replaced the more resource-intensive foreground services. This helped reduce battery usage significantly while maintaining timing accuracy. The modular structure allowed each component, whether video playback or file transfer, to operate independently. This separation enabled future enhancements like isolated troubleshooting, new sequence insertion, and better runtime control.
Value Delivered
The final implementation delivered several layers of value to the client:
- Verified battery optimisation, with the app effectively transitioning the device into deep sleep during test inactivity, confirmed by the client’s Power Analyzer tests.
- Full automation of test flows and accurate timing validation across Android versions 10 to 15, ensuring reliability regardless of the device model or OS update.
- The flexibility of the test architecture meant the client could easily add new test sequences or modify existing ones without overhauling the entire system.
Phase 2 was designed to build on this success by further modularising test steps, integrating the File Transfer App more deeply into the system, and providing a redesigned user interface for easier sequence selection and runtime customisation. Work also continued to refine bearer control and timer synchronisation.
User Feedback
Initial user feedback was positive, especially regarding the test framework's ability to deliver repeatable results with minimal human interaction. Power efficiency was particularly appreciated, with the application outperforming earlier prototypes that relied heavily on foreground tasks. While the client noted limitations with Samsung devices running Android 13+, especially around automated call termination, and the OS-level preference for Wi-Fi routing, the overall sentiment was that these were known OS constraints, not implementation flaws.
Conclusion
Cubet developed a power-optimised, automated Android testing tool capable of simulating realistic user scenarios with precision and minimal system load. The solution represented a shift from traditional, manually intensive testing approaches to a highly modular and autonomous framework. This architecture provides a solid foundation for future scalability, adaptability to new Android OS versions, and ongoing refinement of smartphone performance testing under strict automation requirements. The project reflects Cubet’s strength in engineering technically sound, context-aware solutions tailored to modern Android system constraints.
