1 Android Geofencing Sample 2 =================================== 3 4 When the user enters the vicinity of the Android building (B44) or the Yerba Buena 5 Gardens near the Moscone center in San Francisco, a notification silently appears on their 6 wearable with an option to check in. This notification automatically disappears when they leave 7 the area, and reappears the next time they are at one of these locations. 8 9 Introduction 10 ------------ 11 12 Geofencing combines awareness of the user's current location with awareness of 13 nearby features, defined as the user's proximity to locations that may be of 14 interest. To mark a location of interest, you specify its latitude and longitude. 15 To adjust the proximity for the location, you add a radius. The latitude, 16 longitude, and radius define a geofence. You can have multiple active 17 geofences at one time. 18 19 To use geofencing, start by defining the geofences you want to monitor. 20 Although you usually store geofence data in a local database or download 21 it from the network, you need to send a geofence to Location Services as 22 an instance of [Geofence][2], which you create with `Geofence.Builder`. Each 23 Geofence object contains the following information: 24 25 1. Latitude, longitude, and radius 26 2. Expiration time 27 3. Transition type 28 4. Geofence ID 29 30 Read more about geofences in [Creating and Monitoring Geofences][1]. 31 32 [1]:http://developer.android.com/training/location/geofencing.html 33 [2]:http://developer.android.com/reference/com/google/android/gms/location/Geofence.html 34 35 Pre-requisites 36 -------------- 37 38 - Android SDK v21 39 - Android Build Tools v21.1.1 40 - Android Support Repository 41 42 Screenshots 43 ------------- 44 45 <img src="screenshots/android_building_check_in.png" height="400" alt="Screenshot"/> 46 47 Getting Started 48 --------------- 49 50 This sample uses the Gradle build system. To build this project, use the 51 "gradlew build" command or use "Import Project" in Android Studio. 52 53 Support 54 ------- 55 56 - Google+ Community: https://plus.google.com/communities/105153134372062985968 57 - Stack Overflow: http://stackoverflow.com/questions/tagged/android 58 59 If you've found an error in this sample, please file an issue: 60 https://github.com/googlesamples/android-Geofencing 61 62 Patches are encouraged, and may be submitted by forking this project and 63 submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details. 64 65 License 66 ------- 67 68 Copyright 2014 The Android Open Source Project, Inc. 69 70 Licensed to the Apache Software Foundation (ASF) under one or more contributor 71 license agreements. See the NOTICE file distributed with this work for 72 additional information regarding copyright ownership. The ASF licenses this 73 file to you under the Apache License, Version 2.0 (the "License"); you may not 74 use this file except in compliance with the License. You may obtain a copy of 75 the License at 76 77 http://www.apache.org/licenses/LICENSE-2.0 78 79 Unless required by applicable law or agreed to in writing, software 80 distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 81 WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 82 License for the specific language governing permissions and limitations under 83 the License. 84