Location-based services (LBSs) are often based on an area or place as opposed to an accurate determination of the precise location. However, current mobile software frameworks are geared towards using specific hardware devices (e.g., GPS or 3G or WiFi interfaces) for as precise localization as possible using that device, often at the cost of a significant energy drain. Further, often the location information is not returned promptly enough. To address this problem, we design a framework for mobile devices, called Geo-fencing. The proposed framework is based on the observation that users move from one place to another and then stay at that place for a while. These places can be, for example, airports, shopping centers, home, offices and so on. Geo-fencing defines such places as geographic areas bounded by polygons. It assumes people simply move from fence to fence and stay inside fences for a while. The framework is coordinated with available communication chips and sensors based on their energy usage and accuracy provided. The essential goal is to determine when users check in or out of fences in an energy effiecient fashion so that appropriate LBS can be triggered. Windows based smartphones are used to prototype Geo-fencing. Validations are conducted with the resulting traces of outdoor and indoor activities of several users for several months. The results show that Geo-fencing provides an effective framework for use with LBSs with a significant energy saving for mobile devices.