Missing method in android.net.wifi.WifiManager

前端 未结 3 2001
南方客
南方客 2021-01-19 08:20

On the site androidjavadoc.com, a method startScanActive is listed in the class WifiManager that makes it possible to perform an active wi-fi scan.

相关标签:
3条回答
  • 2021-01-19 08:32

    As I mentioned, look at the official documentation. It's not there. As such, it's not part of the public API, and you should not call it. Even if it's public, it doesn't mean that you can call it.

    Undocumented API calls can disappear without notice at any time in future versions, which will cause your app to break.

    0 讨论(0)
  • 2021-01-19 08:33

    When everything else fails, go to the roots:

    http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3.4_r1/android/net/wifi/WifiManager.java#WifiManager.startScanActive%28%29

    It is a public method in WifiManager since 1.6, although you're correct in saying that Eclipse does not find that method, for some weird reason.

    0 讨论(0)
  • 2021-01-19 08:53

    Here goes my own explanation, based on the cited resources: The function is not contained in the Android SDK. In the source code, it is marked with the Javadoc tag @hide (source), which causes it to be excluded from the documentation but also not to be compiled for the SDK. For testing purposes, an own jar file may be compiled and used. But on the cell phone itself, it will depend on the vendor if the method will be present.

    Similar question. Post on androidjavadoc.com.

    0 讨论(0)
提交回复
热议问题