Mobile applications often need location data, to update locally relevant information and adapt the device context. While most smart-phones do include a GPS receiver, its frequent use is restricted due to high battery drain. We design and prototype an adaptive location service for mobile devices, a-Loc, that helps reduce this battery drain. Our design is based on the observation that the required location accuracy varies with location, and hence lower energy and lower accuracy localization methods, such as those based on WiFi and cell-tower triangulation, can sometimes be used. Our method automatically determines the dynamic accuracy requirement for mobile search-based applications. As the user moves, both the accuracy requirements and the location sensor errors change. A-Loc continually tunes the energy expenditure to meet the changing accuracy requirements using the available sensors. A Bayesian estimation framework is used to model user location and sensor errors. Experiments are performed with Android G1 and AT&T Tilt phones, on paths that include outdoor and indoor locations, using war-driving data from Google and Microsoft. The experiments show that a-Loc not only provides significant energy savings, but also improves the accuracy achieved, because it uses multiple sensors.