The Play Store is consistently pelted with new apps that always run in the background, counting our steps, tracking our location, or listening to us as we sleep. These tasks require that a process remains in an active state, and whenever there's any activity going on within a smartphone, battery life takes a hit. Android 4.4 reduces the impact of these processes with new support for hardware sensor batching.

This optimization allows Android to collect and deliver sensor events in clumps, rather than keep track of them individually. Think of this as the difference between ordering one T-shirt and ordering a thousand. Just as producing a product in bulk is easier on the manufacturer, sending bite-sized tracking data in batches puts less of a strain on your phone, as it reduces how often it has to wake up from an idle state.

KitKat also adds platform support for two new sensors, step detector and step counter. The former can recognize when a user takes a step and trigger an event as a result, while the latter tracks the total number of steps taken since the last device reboot. Here that is again, in developer speak:

TYPE_STEP_DETECTORThis sensor triggers an event each time the user takes a step. Upon each user step, this sensor delivers an event with a value of 1.0 and a timestamp indicating when the step occurred.

TYPE_STEP_COUNTERThis sensor also triggers an event upon each detected step, but instead delivers the total accumulated number of steps since this sensor was first registered by an app.

Since these functions are now implemented into the platform and underlying hardware, individual app developers no longer have to develop their own detection algorithms. These sensors are already available in the Nexus 5, but Google is working with chipset partners to bring support to additional hardware as quickly as they can.

Source: Android Developers Blog [1],[2]