로컬 전용 Wi-Fi 핫스팟 사용

로컬 전용 핫스팟을 사용하여 Wi-Fi 핫스팟을 사용하여 서로 통신할 수 있습니다. 이 항목으로 생성된 네트워크는 메서드가 인터넷에 액세스할 수 없게 됩니다. 각 애플리케이션은 단일 요청을 사용할 수 있지만 여러 애플리케이션이 동일한 핫스팟을 요청할 수 있습니다 있습니다. 여러 애플리케이션이 동시에 등록되면 애플리케이션은 기본 핫스팟을 공유합니다. LocalOnlyHotspotCallback.onStarted(LocalOnlyHotspotReservation) 핫스팟을 사용할 준비가 되면 호출됩니다.

앱이 Android 13 (API 수준 33) 이상을 타겟팅하는 경우 NEARBY_WIFI_DEVICES 로컬 전용 핫스팟을 사용하세요. 이전 버전의 Android를 타겟팅하는 앱은 대신 ACCESS_FINE_LOCATION를 요청해야 합니다.

<manifest ...>
    <<!-- If your app targets Android 13 (API level 33)
          or higher, you must declare the NEARBY_WIFI_DEVICES permission. -->
    <uses-permission android:name="android.permission.NEARBY_WIFI_DEVICES"
                     <!-- If your app derives location information from
                          Wi-Fi APIs, don't include the "usesPermissionFlags"
                          attribute. -->
                     android:usesPermissionFlags="neverForLocation" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"
                     <!-- If any feature in your app relies on
                          precise location information, don't include the
                          "maxSdkVersion" attribute. -->
                     android:maxSdkVersion="32" />
    <application ...>
        ...
    </application>
</manifest>

로컬 전용 핫스팟 사용에 대한 자세한 내용은 다음을 참조하세요. startLocalOnlyHotspot()