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