バックグラウンドでの位置情報へのアクセス
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
位置情報権限をリクエストするとプライバシーに関するおすすめの方法のページで説明されているとおり、アプリはユーザー向けの機能に必要な位置情報権限を要求し、それをユーザーに適切に開示する必要があります。ほとんどのユースケースにおいて、位置情報が必要になるのは、ユーザーがアプリを操作しているときに限られます。アプリがバックグラウンドで位置情報にアクセスする場合(ジオフェンスを実装する場合など)は、位置情報がアプリの中核的機能にとって必要不可欠であること、ユーザーにとって明白なメリットがあること、位置情報にアクセスしていることをユーザーが認識できることが要件として求められます。
注: Google Play ストアは、デバイスの位置情報に関するポリシーを更新しました。アプリによるバックグラウンドでの位置情報へのアクセスは、アプリの中核的機能にとって必要不可欠で、関連するポリシー要件を満たす場合にのみ許可されます。ここで説明するおすすめの方法を採用しても、アプリがバックグラウンドで位置情報を利用することを Google Play が承認するとは限りません。
詳細については、デバイス位置情報に関するポリシーの変更をご覧ください。
バックグラウンドでの位置情報へのアクセスに関するチェックリスト
バックグラウンドで行われる可能性がある位置情報アクセス ロジックを見つけるには、下記のチェックリストを使用します。
バックグラウンドでの位置情報へのアクセスを評価する
アプリがバックグラウンドで位置情報にアクセスすることがわかった場合は、以下のアクションを行うことを検討してください。
- バックグラウンドでの位置情報へのアクセスがアプリの中核的機能にとって必要不可欠かどうかを評価します。
バックグラウンドで位置情報にアクセスする必要がない場合は、その処理を削除します。
Android 10(API レベル 29)以上をターゲットとするアプリの場合は、アプリのマニフェストから ACCESS_BACKGROUND_LOCATION
権限を削除します。この権限を削除すると、アプリは Android 10 を実行するデバイスで位置情報への常時アクセスを選択することができなくなります。
アプリがバックグラウンドで位置情報にアクセスしているとき、ユーザーがそれを認識できることを確認します。これは、バックグラウンドでの位置情報へのアクセスがユーザーにとってわかりにくい場合、特に重要です。
可能であれば、位置情報アクセス ロジックをリファクタリングして、アプリのアクティビティがユーザーに明示されるときに限り、位置情報をリクエストするようにします。
バックグラウンドでの位置情報の更新に対する制限
アプリがバックグラウンドで位置情報にアクセスする必要がある場合、Android 8.0(API レベル 26)以上を実行するデバイスでは、Android がデバイスの電池寿命を節約するためにバックグラウンド位置情報の制限を設定することに留意してください。Android のこれらのバージョンでは、アプリがバックグラウンドで実行されている場合、位置情報の更新データを受信できるのは 1 時間あたり数回だけです。詳細については、バックグラウンド位置情報の制限をご覧ください。
参考情報
バックグラウンドでの位置情報の使用について詳しくは、以下の資料をご覧ください。
動画
バックグラウンドでの位置情報の使用を確認する方法
サンプル
サンプル: バックグラウンドで動作中のアプリが位置情報にアクセスする際のおすすめの方法を示すためのサンプル。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[null,null,["最終更新日 2025-07-27 UTC。"],[],[],null,["# Access location in the background\n\nAs described on the [request location\npermissions](/training/location/permissions) and [privacy best\npractices](/privacy/best-practices) pages, apps should only ask for the type of\nlocation permission that's critical to the user-facing feature, and properly\ndisclose this to users. The majority of use cases only require location when the\nuser is engaging with the app. If your app requires background location, such as\nwhen implementing geofencing, make sure that it's critical to the core\nfunctionality of the app, offers clear benefits to the user, and is done in a\nway that's obvious to them. \n**Note:** The Google Play store has updated its policy concerning device\nlocation, restricting background location access to apps that need it for\ntheir core functionality and meet related policy requirements. Adopting these\nbest practices doesn't guarantee Google Play approves your app's usage of\nlocation in the background.\n\nLearn more about the\n[policy\nchanges](https://support.google.com/googleplay/android-developer/answer/9799150) related to device location.\n\nBackground location access checklist\n------------------------------------\n\nUse the following checklist to identify potential location access logic in the\nbackground:\n\n- In your app's manifest, check for the\n [`ACCESS_COARSE_LOCATION` permission](/reference/android/Manifest.permission#ACCESS_COARSE_LOCATION)\n and the\n [`ACCESS_FINE_LOCATION` permission](/reference/android/Manifest.permission#ACCESS_FINE_LOCATION).\n Verify that your app requires these location permissions.\n\n - If your app targets Android 10 (API level 29) or higher, also check for the [`ACCESS_BACKGROUND_LOCATION`\n permission](/training/location/receive-location-updates#request-background-location). Verify that your app has a feature that requires it.\n- Look for use of location access APIs, such as the [Fused Location Provider\n API](https://developers.google.com/location-context/fused-location-provider),\n [Geofencing API](https://developers.google.com/location-context/geofencing), or\n [LocationManager API](/reference/android/location/LocationManager), within your\n code such as in the following constructs:\n\n - [Background services](/training/run-background-service/create-service)\n - [`JobIntentService`](/reference/kotlin/androidx/core/app/JobIntentService) objects\n - [`WorkManager`](/reference/kotlin/androidx/work/WorkManager) or [`JobScheduler`](/reference/kotlin/android/app/job/JobScheduler) tasks\n - [`AlarmManager`](/reference/kotlin/android/app/AlarmManager) operations\n - Pending intents that are invoked from an [app\n widget](/guide/topics/appwidgets)\n- If your app uses an SDK or library that accesses location, this access is\n attributed to your app. To determine whether an SDK or library needs location\n access, consult the library's documentation.\n\nEvaluate background location access\n-----------------------------------\n\nIf you find that your app accesses location in the background, consider taking\nthe following actions:\n\n- Evaluate whether background location access is critical to the core functionality of the app.\n- If you don't need location access in the background, remove it.\n\n If your app targets Android 10 (API level 29) or higher, remove the\n [`ACCESS_BACKGROUND_LOCATION`\n permission](/training/location/receive-location-updates#request-background-location)\n from your app's manifest. When you remove this permission, all-the-time\n access to location isn't an option for the app on devices that run\n Android 10.\n- Make sure the user is aware that your app is accessing location in the\n background. This is especially important for cases that aren't obvious to users.\n\n- If possible, [refactor your location access\n logic](/about/versions/oreo/background-location-limits#tuning-behavior) so that\n you request location only when your app's activity is visible to users.\n\nLimited updates to background location\n--------------------------------------\n\nIf background location access is essential for your app, keep in mind that\nAndroid preserves device battery life by setting *background location\nlimits* on devices that run Android 8.0 (API level 26) and higher. On these\nversions of Android, if your app is running in the background, it can receive\nlocation updates only a few times each hour. Learn more about [background\nlocation limits](/about/versions/oreo/background-location-limits).\n\nAdditional resources\n--------------------\n\nTo learn more about background location usage, view the following materials:\n\n### Videos\n\n[How to find possible background location\nusage](https://www.youtube.com/watch?v=xTVeFJZQ28c)\n\n### Samples\n\n[Sample](https://github.com/android/platform-samples/tree/main/samples/location/src/main/java/com/example/platform/location/bglocationaccess)\nto demonstrate best practices for accessing location when app is in background."]]