Home | History | Annotate | Download | only in Geofencing
      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 
     26 
     27     <!-- change minSdk if needed-->
     28     <minSdk>18</minSdk>
     29 
     30     <dependency>com.google.android.gms:play-services-location:6.5.+</dependency>
     31 
     32 
     33     <strings>
     34         <intro>
     35             <![CDATA[
     36             When a user enters the vicinity of the Android building (B44) or the Yerba Buena
     37             Gardens near the Moscone center in San Francisco, a notification silently appears on his/her
     38             wearable with an option to check in. This notification automatically disappears when he/she leaves
     39             the area, and reappears the next time he/she is at one of these locations.
     40             ]]>
     41         </intro>
     42     </strings>
     43 
     44     <template src="base"/>
     45     <template src="Wear"/>
     46 
     47     <metadata>
     48         <status>PUBLISHED</status>
     49         <categories>Wearable, Sensors</categories>
     50         <technologies>Android</technologies>
     51         <languages>Java</languages>
     52         <solutions>Mobile</solutions>
     53         <level>ADVANCED</level>
     54         <icon>screenshots/icon-web.png</icon>
     55         <screenshots>
     56             <img>screenshots/android_building_check_in.png</img>
     57         </screenshots>
     58         <api_refs>
     59             <android>com.google.android.gms.location.Geofence</android>
     60         </api_refs>
     61         <description>
     62 <![CDATA[
     63 When the user enters the vicinity of the Android building (B44) or the Yerba Buena
     64 Gardens near the Moscone center in San Francisco, a notification silently appears on their
     65 wearable with an option to check in. This notification automatically disappears when they leave
     66 the area, and reappears the next time they are at one of these locations.
     67 ]]>
     68         </description>
     69         <intro>
     70 <![CDATA[
     71 Geofencing combines awareness of the user's current location with awareness of
     72 nearby features, defined as the user's proximity to locations that may be of
     73 interest. To mark a location of interest, you specify its latitude and longitude.
     74 To adjust the proximity for the location, you add a radius. The latitude,
     75 longitude, and radius define a geofence. You can have multiple active
     76 geofences at one time.
     77 
     78 To use geofencing, start by defining the geofences you want to monitor.
     79 Although you usually store geofence data in a local database or download
     80 it from the network, you need to send a geofence to Location Services as
     81 an instance of [Geofence][2], which you create with `Geofence.Builder`. Each
     82 Geofence object contains the following information:
     83 
     84 1. Latitude, longitude, and radius
     85 2. Expiration time
     86 3. Transition type
     87 4. Geofence ID
     88 
     89 Read more about geofences in [Creating and Monitoring Geofences][1].
     90 
     91 [1]:http://developer.android.com/training/location/geofencing.html
     92 [2]:http://developer.android.com/reference/com/google/android/gms/location/Geofence.html
     93 ]]>
     94         </intro>
     95     </metadata>
     96 </sample>
     97