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