수십억 사용자를 위한 배터리 소비
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2024-02-22(UTC)
[null,null,["최종 업데이트: 2024-02-22(UTC)"],[],[],null,["# Battery consumption for billions\n\nAccess to reliable power supplies varies, and outages can disrupt planned\ncharges. Defend your users' batteries against unnecessary drain by benchmarking\nyour battery use, avoiding wakelocks, scheduling tasks, and monitoring sensor\nrequests.\n\nReduce battery consumption\n--------------------------\n\n\nThere are several steps you can take to help make sure that your app\nis only consuming battery power when it needs to, and that it's not\nconsuming more power than necessary.\n\n- Your app should minimize its activity when in the background and when the device is running on battery power.\n- Sensors, such as GPS sensors, can drain battery significantly. Avoid issues by using the [`FusedLocationProvider`](https://developers.google.com/android/reference/com/google/android/gms/location/FusedLocationProviderApi) API to manage the underlying location technology. It provides a simple API so that you can specify requirements---such as high accuracy or low power---at a high level. It also optimizes the device's use of battery power by caching locations and batching requests across apps. For more information about the ideal ways to request location, see the [Getting the Last\n Known Location](/training/location/retrieve-current) training guide.\n- [Wake\n locks](/reference/android/os/PowerManager.WakeLock) are mechanisms to keep devices on so that they can perform background activities. Avoid using wake locks because they prevent the device from going into low-power states.\n- To reduce the number of device wake-ups, batch network activity. For more information on batching, see the Android training on [Optimizing Downloads for Efficient Network Access](/training/efficient-downloads/efficient-network-access).\n- [WorkManager](/topic/libraries/architecture/workmanager) schedules tasks and lets the system batch operations. This greatly simplifies the implementation of common patterns, such as waiting for network connectivity, device charging state, retries, and backoff. Use WorkManager to perform non-essential background activity when the device is charging and is connected to an unmetered network.\n- For more information on how network activity can drain the battery, and how to tackle this issue, see [Reducing Network Battery Drain](/topic/performance/power/network).\n\nBenchmark battery use\n---------------------\n\n\nBenchmarking your app's battery use in a controlled environment helps you\nunderstand the battery-heavy tasks in your app. It's a good practice to\nbenchmark your app's battery use to gauge efficiency and track changes\nover time.[Batterystats](/tools/performance/batterystats-battery-historian) collects battery data about your apps, and [Battery Historian](/tools/performance/batterystats-battery-historian) converts that data into an HTML visualization.\n\n\nFor\nmore information on reducing battery use, see the Android training on [Optimizing\nBattery Life](/training/monitoring-device-state).\n\nRelated\n-------"]]