Mobile Applications are rapidly emerging as a convenient medium for using a variety of services. In ubiquitous environment, the challenge relies on developing applications that sense and react to environmental changes to provide a value-added user experience. This context awareness property improves application usability. Context information can be related to the environment, user but also to the device itself. Since smart phones are battery-powered, in an ideal scenario, the application will self-adapt and adjust its behavior according to the current battery status of the device. In this paper, we address the challenge of building self-adaptive battery-aware applications for mobile devices. Our solution is based on a dynamic feature configuration to adapt efficiently to the device status. We propose a distributed battery-awareness architecture where both the mobile client and the server side optimize the battery utilization when needed. We also propose three layers of dynamic adaptation: user features' availability adaptation, internal features' behavior adaptation, and data consumption adaptation. As illustrated by the experiments, doing the right adaptation in both server and client sides increases the lifetime span of the mobile device and hence the availability of the application.