1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 Copyright 2015 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<sample>
18    <name>RuntimePermissionsBasic</name>
19    <group>System</group>
20    <package>com.example.android.basicpermissions</package>
21
22    <minSdk>15</minSdk>
23
24    <strings>
25        <intro>
26            <![CDATA[
27            This sample shows a basic implementation for requesting permissions at runtime. Click the button to request the Camera permission and open a full-screen camera preview.
28Note: The "RuntimePermissions" sample provides a more complete overview over the runtime permission features available.
29            ]]>
30        </intro>
31    </strings>
32
33    <template src="base-build"/>
34
35    <metadata>
36        <status>PUBLISHED</status>
37        <categories>System</categories>
38        <technologies>Android</technologies>
39        <languages>Java</languages>
40        <solutions>Mobile</solutions>
41        <level>BEGINNER</level>
42        <icon>screenshots/big_icon.png</icon>
43        <screenshots>
44            <img>screenshots/screenshot-1.png</img>
45        </screenshots>
46        <api_refs>
47            <android>android.app.Activity</android>
48            <android>android.Manifest.permission</android>
49        </api_refs>
50
51        <description>
52<![CDATA[
53This basic sample shows runtime permissions available in the Android M and above.
54It shows how to use the new runtime permissions API to check and request permissions through the
55support library.
56]]>
57        </description>
58
59        <intro>
60<![CDATA[
61Android M introduced runtime permissions. Applications targeting M and above need to request their
62permissions at runtime.
63This sample introduces the basic use of the runtime permissions API through the support library by
64verifying permissions (ActivityCompat#checkSelfPermission(Context, String)), requesting permissions (ActivityCompat#requestPermissions(Activity, String[], int))
65and handling the permission request callback (ActivityCompat.OnRequestPermissionsResultCallback).
66An application can display additional context and justification for a permission after calling
67ActivityCompat#shouldShowRequestPermissionRationale#shouldShowRequestPermissionRationale(Activity, String).
68
69See the "RuntimePermissions" sample for a more complete description and reference implementation.
70]]>
71        </intro>
72    </metadata>
73</sample>
74