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