불필요한 백그라운드 Wi-Fi 검색
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
앱이 백그라운드에서 Wi-Fi 검색을 실행하면 CPU의 절전 모드를 해제하여 배터리 소모율을 높입니다. 검색이 너무 많이 발생하면 기기의 배터리 수명이 현저하게 단축될 수 있습니다. 앱이 PROCESS_STATE_BACKGROUND
또는 PROCESS_STATE_CACHED
상태이면 백그라운드에서 실행 중인 것으로 간주됩니다.
이 문서에서는 앱이 백그라운드에서 너무 많은 Wi-Fi 검색을 실행하는 경우를 감지하는 방법을 설명하고 문제 진단 및 해결 방법에 관한 도움말을 제공합니다.
문제 감지
앱의 Wi-Fi 검색 횟수가 과도하게 많다는 것을 항상 알 수 있는 것은 아닙니다. 앱을 이미 게시했다면 Android vitals를 사용하여 문제를 파악한 후 해결할 수 있습니다.
Android vitals
Android vitals를 사용하면 앱이 백그라운드에서 불필요한 Wi-Fi 검색을 실행하는 경우 Play Console을 통해 알림을 받아 앱의 성능을 개선할 수 있습니다. 앱이 시간당 5회 이상의 검색을 실행하면 Android vitals에서는 불필요한 Wi-Fi 검색으로 간주합니다.
Play Console에서는 이 동작을 보이는 배터리 세션의 비율을 확인할 수 있습니다.
배터리 세션의 정의는 플랫폼 버전에 따라 다릅니다.
- Android 10에서 배터리 세션은 24시간 기간 동안 수신된 모든 배터리 보고의 집계입니다. Android 10에서 배터리 보고는 두 번의 배터리 충전(20% 이하에서 80% 이상으로의 충전 또는 배터리 잔량에 관계없이 100%로의 충전) 사이의 간격을 의미합니다.
- Android 11에서 배터리 세션은 고정된 24시간 기간입니다.
Google Play에서 Android vitals 데이터를 수집하는 방법에 관한 자세한 내용은 Play Console 문서를 참고하세요.
Wi-Fi 검색 조사
Battery Historian과 같은 도구를 사용하면 앱의 검색 동작을 더 자세히 알아볼 수 있습니다. Battery Historian은 앱별로 Wi-Fi 검색 동작을 시각화하여 앱에서 발생하는 상황을 명확하게 파악하는 데 도움이 될 수 있습니다. Battery Historian에 관한 자세한 내용은 Battery Historian으로 전원 사용량 분석을 참고하세요.
Battery Historian 사용의 역학에 관한 자세한 내용은 Batterystats 및 Battery Historian 둘러보기를 참고하세요.
검색 수 줄이기
가능한 경우 앱이 포그라운드에서 실행되는 동안 Wi-Fi 검색을 실행해야 합니다. 포그라운드 서비스는 자동으로 알림을 제공하므로 포그라운드에서 Wi-Fi 검색을 실행하면 사용자가 기기에서 Wi-Fi 검색이 발생하는 이유와 시기를 알 수 있습니다.
포그라운드에서 검색하는 방법에 관한 자세한 내용은 WifiManager
클래스의 문서를 참고하세요.
앱이 백그라운드에서 실행되는 동안 Wi-Fi 검색 실행을 방지할 수 없을 때 Lazy First 전략을 적용하면 도움이 될 수 있습니다. Lazy First에는 Wi-Fi 검색을 줄이는 데 사용할 수 있는 세 가지 기법(축소, 지연 및 병합)이 포함됩니다.
이러한 기법에 관한 자세한 내용은 배터리 수명 최적화를 참고하세요.
추천 서비스
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[null,null,["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# Excessive Wi-Fi Scanning in the Background\n\nWhen an app performs Wi-Fi scans in the background, it wakes up the CPU,\ncausing rate of battery drain. When too many scans occur, the device's\nbattery life may be noticeably shortened. An app is considered to be running in\nthe background if it is in the `PROCESS_STATE_BACKGROUND` or\n`PROCESS_STATE_CACHED` state.\n\nThis document explains how to detect when your app is performing too many Wi-Fi\nscans in the background, and provides tips about diagnosing and addressing\nthe problem.\n\nDetect the problem\n------------------\n\nYou may not always know that your app is exhibiting an inordinate\nnumber of Wi-Fi scans. If you have already published your app,\nAndroid vitals can make you aware of the problem so that you can fix it.\n\n### Android vitals\n\nAndroid vitals can help improve your app's performance by alerting you via the\n[Play Console](https://play.google.com/console/) when your app is\nperforming excessive Wi-Fi scanning in the background. Android vitals considers\nWi-Fi scanning excessive when an app performs more than 4 scans per hour.\nIn Play Console you can check percentage of *battery sessions* that exhibit\nthis behavior.\n\nThe definition of *battery session* depends on the platform version.\n\n- In Android 10, a battery session is the aggregation of all battery reports received within a given 24-hour period. A *battery report* refers to the interval between two battery charges either from below 20% to above 80% or from any charge level to 100%.\n- In Android 11, a battery session is a fixed 24-hour period.\n\nFor information on how Google Play collects Android vitals data, see the [Play\nConsole](https://support.google.com/googleplay/android-developer/answer/7385505)\ndocumentation.\n\nInvestigate the Wi-Fi scans\n---------------------------\n\nTools such as Battery Historian can help you gain more insight into your\napp's scanning behavior. Battery Historian provides a visualization of Wi-Fi\nscanning behavior on a per-app basis, which can help you gain a clearer\npicture of what's happening with your app. For more information about Battery\nHistorian, see\n[Analyzing Power Use with Battery Historian](/topic/performance/power/battery-historian#asd).\n\nFor information about the mechanics of using Battery Historian, see\n[Batterystats and Battery Historian Walkthrough](/topic/performance/power/setup-battery-historian).\n\nReduce the scans\n----------------\n\nIf possible, your app should be performing Wi-Fi scans while the app is running\nin the foreground. Foreground services automatically present notifications;\nperforming Wi-Fi scans in the foreground thus makes the user aware of the\nwhy and when Wi-Fi scans take place on their device.\n\nFor information on how to scan while in the foreground,\nsee the documentation for the\n[`WifiManager`](/reference/android/net/wifi/WifiManager#startScan()) class.\n\nIf your app cannot avoid performing Wi-Fi scans while the app is running in\nthe background, it may benefit from applying\na [Lazy First](/topic/performance/power#lazy) strategy. Lazy First\nencompasses three techniques that you can use to cut down on Wi-Fi scans:\n*reduce* , *defer* , and *coalesce* .\nFor information about these techniques, see\n[Optimizing for Battery Life](/topic/performance/power).\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [Excessive Mobile Network Usage in Background](/topic/performance/vitals/bg-network-usage)"]]