xref: /aosp_15_r20/developers/build/prebuilts/gradle/RuntimePermissionsWear/README.md (revision d353a188ca6ec4b5eba25b5fbd7bcb8ce61322fb)
1*d353a188SXin Li
2*d353a188SXin LiAndroid RuntimePermissionsWear Sample
3*d353a188SXin Li===================================
4*d353a188SXin Li
5*d353a188SXin LiA sample that shows how you can handle remote data that requires permissions both on
6*d353a188SXin Lia wearable device and a mobile device.
7*d353a188SXin Li
8*d353a188SXin LiIntroduction
9*d353a188SXin Li------------
10*d353a188SXin Li
11*d353a188SXin LiSteps for trying out this sample:
12*d353a188SXin Li* Compile and install the mobile app onto your mobile device or emulator.
13*d353a188SXin Li* Compile and install the wearable app onto your Wear device or emulator.
14*d353a188SXin Li(**Note:** wearable apps are not automatically pushed from your mobile device
15*d353a188SXin Liunless you build a production release, see [here][3] for more info).
16*d353a188SXin Li* Start the mobile or wear app. Each app contains two buttons: one for showing
17*d353a188SXin Lilocal data and another for showing remote data.
18*d353a188SXin Li* Click either button to view the data. Both local and remote data require
19*d353a188SXin Li[dangerous permissions][4] to be approved before displaying the data for
20*d353a188SXin Lidevices running 23 or above. You will be asked to approve the access if you
21*d353a188SXin Lido not have the proper permissions.
22*d353a188SXin Li* The happy icon signifies you have access to the data while the sad icon
23*d353a188SXin Lisignifies you do or may not have access (and may be asked to approve access).
24*d353a188SXin Li
25*d353a188SXin LiThis sample demonstrates how to access data and trigger permission approval
26*d353a188SXin Lion remote devices. It uses [Services][5] and the [Wearable MessageApi][2] to
27*d353a188SXin Licommunicate between devices.
28*d353a188SXin Li
29*d353a188SXin LiTo find out more about wear, visit our [developer Wear page][1].
30*d353a188SXin Li
31*d353a188SXin Li[1]: http://developer.android.com/wear/
32*d353a188SXin Li[2]: https://developer.android.com/reference/com/google/android/gms/wearable/MessageApi.html
33*d353a188SXin Li[3]: https://developer.android.com/training/wearables/apps/creating.html#Install
34*d353a188SXin Li[4]: http://developer.android.com/guide/topics/security/permissions.html#normal-dangerous
35*d353a188SXin Li[5]: http://developer.android.com/guide/components/services.html
36*d353a188SXin Li
37*d353a188SXin LiPre-requisites
38*d353a188SXin Li--------------
39*d353a188SXin Li
40*d353a188SXin Li- Android SDK 27
41*d353a188SXin Li- Android Build Tools v27.0.2
42*d353a188SXin Li- Android Support Repository
43*d353a188SXin Li
44*d353a188SXin LiScreenshots
45*d353a188SXin Li-------------
46*d353a188SXin Li
47*d353a188SXin Li<img src="screenshots/screenshot-wear.png" height="400" alt="Screenshot"/> <img src="screenshots/screenshot-phone.png" height="400" alt="Screenshot"/>
48*d353a188SXin Li
49*d353a188SXin LiGetting Started
50*d353a188SXin Li---------------
51*d353a188SXin Li
52*d353a188SXin LiThis sample uses the Gradle build system. To build this project, use the
53*d353a188SXin Li"gradlew build" command or use "Import Project" in Android Studio.
54*d353a188SXin Li
55*d353a188SXin LiSupport
56*d353a188SXin Li-------
57*d353a188SXin Li
58*d353a188SXin Li- Google+ Community: https://plus.google.com/communities/105153134372062985968
59*d353a188SXin Li- Stack Overflow: http://stackoverflow.com/questions/tagged/android
60*d353a188SXin Li
61*d353a188SXin LiIf you've found an error in this sample, please file an issue:
62*d353a188SXin Lihttps://github.com/googlesamples/android-RuntimePermissionsWear
63*d353a188SXin Li
64*d353a188SXin LiPatches are encouraged, and may be submitted by forking this project and
65*d353a188SXin Lisubmitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
66*d353a188SXin Li
67*d353a188SXin LiLicense
68*d353a188SXin Li-------
69*d353a188SXin Li
70*d353a188SXin LiCopyright 2017 The Android Open Source Project, Inc.
71*d353a188SXin Li
72*d353a188SXin LiLicensed to the Apache Software Foundation (ASF) under one or more contributor
73*d353a188SXin Lilicense agreements.  See the NOTICE file distributed with this work for
74*d353a188SXin Liadditional information regarding copyright ownership.  The ASF licenses this
75*d353a188SXin Lifile to you under the Apache License, Version 2.0 (the "License"); you may not
76*d353a188SXin Liuse this file except in compliance with the License.  You may obtain a copy of
77*d353a188SXin Lithe License at
78*d353a188SXin Li
79*d353a188SXin Lihttp://www.apache.org/licenses/LICENSE-2.0
80*d353a188SXin Li
81*d353a188SXin LiUnless required by applicable law or agreed to in writing, software
82*d353a188SXin Lidistributed under the License is distributed on an "AS IS" BASIS, WITHOUT
83*d353a188SXin LiWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
84*d353a188SXin LiLicense for the specific language governing permissions and limitations under
85*d353a188SXin Lithe License.
86