Android 권한의 목표는 Android 사용자의 개인 정보 보호를 위한 것입니다. 앱이 연락처나 사진과 같은 민감한 정보의 데이터 유형과 위치나 걸음 수 감지와 같은 시스템 기능에 액세스하려고 할 때 사용자에게 메시지를 표시합니다. 사용자가 다음 권한을 부여함
할 수 있습니다.
앱에서 이러한 데이터 유형 중 하나에 액세스해야 하는 경우
(Google 피트니스 데이터 유형의 하위 집합)
OAuth 권한을 요청하기 전에 Android 권한을 요청해야 합니다.
아래를 참고하세요.
if(ContextCompat.checkSelfPermission(thisActivity,Manifest.permission.ACTIVITY_RECOGNITION)!=PackageManager.PERMISSION_GRANTED){// Permission is not granted}
[null,null,["최종 업데이트: 2025-08-31(UTC)"],[[["\u003cp\u003eAndroid permissions protect user privacy by requiring apps to request access to sensitive data and system features.\u003c/p\u003e\n"],["\u003cp\u003eApps need to request specific Android permissions before accessing certain Google Fit data types, such as activity, location, and heart rate data.\u003c/p\u003e\n"],["\u003cp\u003eDifferent data types require different permissions, like \u003ccode\u003eACTIVITY_RECOGNITION\u003c/code\u003e for step count and activity data, \u003ccode\u003eACCESS_FINE_LOCATION\u003c/code\u003e for location data, and \u003ccode\u003eBODY_SENSORS\u003c/code\u003e for heart rate data.\u003c/p\u003e\n"],["\u003cp\u003eRequesting Android permissions involves adding them to the manifest file and implementing logic to handle permission requests for different Android versions.\u003c/p\u003e\n"],["\u003cp\u003eApps targeting older Android versions should be updated to handle potential permission revocations by users on Android 10 and above.\u003c/p\u003e\n"]]],[],null,["# Android Permissions\n\n[Android permissions](https://developer.android.com/guide/topics/permissions/overview) aim to protect the privacy of an Android user. They prompt\nthe user when apps want to access data types for sensitive data like contacts or photos, and\nsystem features like location or step detection. Users grant these permissions\nwhen first downloading your app.\n\nIf your app needs access to any of [these data types](#data_types_that_need_android_permissions)\n(a subset of the Google Fit data types), request the relevant\nAndroid permission before requesting the OAuth permissions.\n[See below](#requesting_android_permissions).\n**Figure 1.**The Android permissions consent screen.\n\n*** ** * ** ***\n\nData types that need Android permissions\n----------------------------------------\n\nTo access these physical activity data types, you'll need to [request the `ACTIVITY_RECOGNITION` Android permission](#requesting_android_permissions):\n\n- To [record](/android/reference/com/google/android/gms/fitness/RecordingClient) these data types:\n\n - `com.google.step_count.delta`\n - `com.google.step_count.cumulative`\n - `com.google.step_count.cadence`\n - `com.google.activity.segment`\n - `com.google.calories.expended`\n- To [read](/android/reference/com/google/android/gms/fitness/HistoryClient) these data types:\n\n - `com.google.step_count.delta`\n - `com.google.step_count.cumulative`\n - `com.google.step_count.cadence`\n - `com.google.activity.segment`\n - `com.google.activity.exercise`\n\nTo access these data types, you'll need to [request the `ACCESS_FINE_LOCATION` Android permission](https://developer.android.com/reference/android/Manifest.permission.html#ACCESS_FINE_LOCATION):\n\n- To read these data types:\n - `com.google.distance.delta`\n - `com.google.location.sample`\n - `com.google.location.bounding_box`\n - `com.google.speed`\n\nTo [record](/android/reference/com/google/android/gms/fitness/RecordingClient) these data types, you'll need to [request the `BODY_SENSORS` Android permission](https://developer.android.com/reference/android/Manifest.permission.html#BODY_SENSORS):\n\n- `com.google.heart_rate.bpm`\n\nRequesting Android permissions\n------------------------------\n\nLearn about [requesting Android permissions](https://developer.android.com/training/permissions/requesting), the\n[physical activity recognition permission](https://developer.android.com/about/versions/10/privacy/changes#physical-activity-recognition), the\n[fine location permission](https://developers.google.com/maps/documentation/android-sdk/location#location_permissions), and the [body sensors permission](https://developer.android.com/reference/android/Manifest.permission.html#BODY_SENSORS).\n\nTo access the data types above with the Google Fit APIs, you'll need to\nimplement logic to handle requesting Android permissions for both Android 10 and\nprevious versions of Android. These examples use the [`ACTIVITY_RECOGNITION`](https://developer.android.com/reference/android/Manifest.permission#ACTIVITY_RECOGNITION) permission. \n\n### Android 10\n\nSo your app can target API level 29 or above, request the permission from the\nuser, and register the permission in the application manifest file.\n\n1. [Add the permission to the manifest file](https://developer.android.com/training/permissions/requesting#perm-add).\n\n \u003cuses-permission android:name=\"android.permission.ACTIVITY_RECOGNITION\"/\u003e\n\n2. [Check if the permission is granted](https://developer.android.com/training/permissions/requesting#perm-check):\n\n if (ContextCompat.checkSelfPermission(thisActivity, Manifest.permission.ACTIVITY_RECOGNITION)\n != PackageManager.PERMISSION_GRANTED) {\n // Permission is not granted\n }\n\n3. If permission isn't already granted, request the permission:\n\n ActivityCompat.requestPermissions(thisActivity,\n arrayOf(Manifest.permission.ACTIVITY_RECOGNITION),\n MY_PERMISSIONS_REQUEST_ACTIVITY_RECOGNITION)\n\n### Android 9 and below\n\nSo your app can target API level 28 or below:\n\n1. Request the `com.google.android.gms.permission.ACTIVITY_RECOGNITION` permission.\n\n2. [Add the permission to the manifest file](https://developer.android.com/training/permissions/requesting#perm-add).\n\n \u003cuses-permission android:name=\"android.gms.permission.ACTIVITY_RECOGNITION\"/\u003e\n\n| **Caution:** If your app targets API level 28 or below but is running on Android 10, the `com.google.android.gms.permission.ACTIVITY_RECOGNITION` permission is converted into a pre-granted runtime permission which can be revoked by the user. If revoked, your app's access to these [physical activity\n| data types](#data_types_that_need_android_permissions) will be blocked. Update your app to handle this situation."]]