1 <?xml version="1.0" encoding="UTF-8"?> 2 <!-- 3 Copyright 2013 The Android Open Source Project 4 5 Licensed under the Apache License, Version 2.0 (the "License"); 6 you may not use this file except in compliance with the License. 7 You may obtain a copy of the License at 8 9 http://www.apache.org/licenses/LICENSE-2.0 10 11 Unless required by applicable law or agreed to in writing, software 12 distributed under the License is distributed on an "AS IS" BASIS, 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 See the License for the specific language governing permissions and 15 limitations under the License. 16 --> 17 18 19 20 <sample> 21 <name>Geofencing</name> 22 <group>Wearable</group> 23 <package>com.example.android.wearable.geofencing</package> 24 25 <minSdk>18</minSdk> 26 <targetSdkVersion>22</targetSdkVersion> 27 <targetSdkVersionWear>22</targetSdkVersionWear> 28 29 <dependency>com.google.android.gms:play-services-location</dependency> 30 31 <wearable> 32 <has_handheld_app>true</has_handheld_app> 33 </wearable> 34 35 <strings> 36 <intro> 37 <![CDATA[ 38 When a user enters the vicinity of the Android building (B44) or the Yerba Buena 39 Gardens near the Moscone center in San Francisco, a notification silently appears on his/her 40 wearable with an option to check in. This notification automatically disappears when he/she leaves 41 the area, and reappears the next time he/she is at one of these locations. 42 ]]> 43 </intro> 44 </strings> 45 46 <template src="base"/> 47 <template src="Wear"/> 48 49 <metadata> 50 <status>DEPRECATED</status> 51 <categories>Wearable, Sensors</categories> 52 <technologies>Android</technologies> 53 <languages>Java</languages> 54 <solutions>Mobile</solutions> 55 <level>ADVANCED</level> 56 <icon>screenshots/icon-web.png</icon> 57 <screenshots> 58 <img>screenshots/android_building_check_in.png</img> 59 </screenshots> 60 <api_refs> 61 <android>com.google.android.gms.location.Geofence</android> 62 </api_refs> 63 <description> 64 <![CDATA[ 65 When the user enters the vicinity of the Android building (B44) or the Yerba Buena 66 Gardens near the Moscone center in San Francisco, a notification silently appears on their 67 wearable with an option to check in. This notification automatically disappears when they leave 68 the area, and reappears the next time they are at one of these locations. 69 ]]> 70 </description> 71 <intro> 72 <![CDATA[ 73 Geofencing combines awareness of the user's current location with awareness of 74 nearby features, defined as the user's proximity to locations that may be of 75 interest. To mark a location of interest, you specify its latitude and longitude. 76 To adjust the proximity for the location, you add a radius. The latitude, 77 longitude, and radius define a geofence. You can have multiple active 78 geofences at one time. 79 80 To use geofencing, start by defining the geofences you want to monitor. 81 Although you usually store geofence data in a local database or download 82 it from the network, you need to send a geofence to Location Services as 83 an instance of [Geofence][2], which you create with `Geofence.Builder`. Each 84 Geofence object contains the following information: 85 86 1. Latitude, longitude, and radius 87 2. Expiration time 88 3. Transition type 89 4. Geofence ID 90 91 Read more about geofences in [Creating and Monitoring Geofences][1]. 92 93 [1]:http://developer.android.com/training/location/geofencing.html 94 [2]:http://developer.android.com/reference/com/google/android/gms/location/Geofence.html 95 ]]> 96 </intro> 97 </metadata> 98 </sample> 99