Motivated by the need of three groups of people: end users, application developers, system developers. We design and implement Bugu, an application level power profiler and analyzer for mobile phones. The Bugu service includes two parts: the Bugu server and the Bugu client . The Bugu server collects applications' power information on each device and supports the Bugu client with these data.

The Bugu client, which contains three component: power profiler , event monitor , power and event analyzer , is used to calculate application power consumption, monitor system events and analyze the problem of application power consumption. The Bugu server as a group of REST services, which were developed with Ruby on Rails and Mysql database. The format we used between client and server is JSON.


The power profiler was implemented as a service called pTopAService, which runs in the background periodically. This service requires the basic power of each device and device utilization information of each application to estimate the power. We got the data from the PowerProfile class and BatteryStats class of Android respectively. The event monitor is implemented by modifying the BatteryStatsService class, which collects all the system and application events that related with battery usage. When this service received an event, it will broad-cast an Intent message, which could be received by a Broadcast-Receiver class in the Bugu client.

The analyzer process the power and event log file, present users final results through meaningful table and figures. The Bugu server provides more suggestions for end user about energy-friendly application and show the power comparison table to them, so that they can istall right applciations to extend battery time. Besides the comparison information, application developer can get event-power relationship of their applications and they can focus on optimize these power hotspots. Moreover, Bugu provides system-wide power information, for system developers, they have chance to analyze background processes that consume much power or do some scheduling to save system power.