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 <sample> 19 <name>RuntimePermissionsWear</name> 20 <group>Wearable</group> 21 <package>com.example.android.wearable.runtimepermissions</package> 22 23 <minSdk>18</minSdk> 24 <targetSdkVersion>23</targetSdkVersion> 25 <targetSdkVersionWear>23</targetSdkVersionWear> 26 27 <wearable> 28 <has_handheld_app>true</has_handheld_app> 29 </wearable> 30 31 <dependency>com.android.support:appcompat-v7:24.0.0</dependency> 32 <dependency>com.android.support:design:24.0.0</dependency> 33 <provided_dependency_wearable>com.google.android.wearable:wearable:1.4.0</provided_dependency_wearable> 34 35 <strings> 36 <intro> 37 <![CDATA[ 38 A sample that shows how you can handle remote data that requires permissions both on 39 a wearable device and a mobile device. 40 ]]> 41 </intro> 42 </strings> 43 44 <!-- The basic templates have already been enabled. Uncomment more as desired. --> 45 <template src="base" /> 46 <template src="WearPlusShared"/> 47 48 <metadata> 49 <!-- Values: {DRAFT | PUBLISHED | INTERNAL | DEPRECATED | SUPERCEDED} --> 50 <status>PUBLISHED</status> 51 <!-- See http://go/sample-categories for details on the next 4 fields. --> 52 <categories>Wearable, Permissions</categories> 53 <technologies>Android</technologies> 54 <languages>Java</languages> 55 <solutions>Mobile</solutions> 56 <level>INTERMEDIATE</level> 57 <!-- Dimensions: 512x512, PNG fomrat --> 58 <icon>screenshots/icon-web.png</icon> 59 <!-- Path to screenshots. Use <img> tags for each. --> 60 <screenshots> 61 <img>screenshots/screenshot-wear.png</img> 62 <img>screenshots/screenshot-phone.png</img> 63 </screenshots> 64 <!-- List of APIs that this sample should be cross-referenced under. Use <android> 65 for fully-qualified Framework class names ("android:" namespace). 66 67 Use <ext> for custom namespaces, if needed. See "Samples Index API" documentation 68 for more details. --> 69 <api_refs> 70 <android>android.support.v4.app.ActivityCompat</android> 71 <android>android.support.v7.app.AppCompatActivity</android> 72 <android>android.support.wearable.activity.WearableActivity</android> 73 <android>android.support.wearable.view.WatchViewStub</android> 74 <android>com.google.android.gms.common.api.GoogleApiClient</android> 75 <android>com.google.android.gms.wearable.CapabilityApi</android> 76 <android>com.google.android.gms.wearable.CapabilityInfo</android> 77 <android>com.google.android.gms.wearable.DataMap</android> 78 <android>com.google.android.gms.wearable.MessageApi</android> 79 <android>com.google.android.gms.wearable.MessageEvent</android> 80 <android>com.google.android.gms.wearable.Node</android> 81 <android>com.google.android.gms.wearable.Wearable</android> 82 <android>com.google.android.gms.wearable.WearableListenerService</android> 83 </api_refs> 84 85 <!-- 1-3 line description of the sample here. 86 87 Avoid simply rearranging the sample's title. What does this sample actually 88 accomplish, and how does it do it? --> 89 <description> 90 A sample that shows how you can handle remote data that requires permissions both on 91 a wearable device and a mobile device. 92 </description> 93 94 <!-- Multi-paragraph introduction to sample, from an educational point-of-view. 95 Makrdown formatting allowed. This will be used to generate a mini-article for the 96 sample on DAC. --> 97 <intro> 98 <![CDATA[ 99 Steps for trying out this sample: 100 * Compile and install the mobile app onto your mobile device or emulator. 101 * Compile and install the wearable app onto your Wear device or emulator. 102 (**Note:** wearable apps are not automatically pushed from your mobile device 103 unless you build a production release, see [here][3] for more info). 104 * Start the mobile or wear app. Each app contains two buttons: one for showing 105 local data and another for showing remote data. 106 * Click either button to view the data. Both local and remote data require 107 [dangerous permissions][4] to be approved before displaying the data for 108 devices running 23 or above. You will be asked to approve the access if you 109 do not have the proper permissions. 110 * The happy icon signifies you have access to the data while the sad icon 111 signifies you do or may not have access (and may be asked to approve access). 112 113 This sample demonstrates how to access data and trigger permission approval 114 on remote devices. It uses [Services][5] and the [Wearable MessageApi][2] to 115 communicate between devices. 116 117 To find out more about wear, visit our [developer Wear page][1]. 118 119 [1]: http://developer.android.com/wear/ 120 [2]: https://developer.android.com/reference/com/google/android/gms/wearable/MessageApi.html 121 [3]: https://developer.android.com/training/wearables/apps/creating.html#Install 122 [4]: http://developer.android.com/guide/topics/security/permissions.html#normal-dangerous 123 [5]: http://developer.android.com/guide/components/services.html 124 ]]> 125 </intro> 126 </metadata> 127 </sample> 128