java.lang.Object | |
↳ | android.net.ConnectivityManager |
这个类用来查询当前网络状态,通知网络状态变化。
Class that answers queries about the state of network connectivity. It also notifies applications when network connectivity changes. Get an instance of this class by callingContext.getSystemService(Context.CONNECTIVITY_SERVICE)
.
The primary responsibilities of this class are to:
- Monitor network connections (Wi-Fi, GPRS, UMTS, etc.)
- Send broadcast intents when network connectivity changes
- Attempt to "fail over" to another network when connectivity to a network is lost
- Provide an API that allows applications to query the coarse-grained or fine-grained state of the available networks.
- 监视网络连接(WIFI,GPRS,UMTS等)
- 当网络变化时发出broadcast.
- 当目前的网络丢失的时候尝试转移到另一个网络
- 提供API来允许AP查询当前可用网络的精确度
NetworkInfo | getActiveNetworkInfo() |
NetworkInfo[] | getAllNetworkInfo() |
boolean | getBackgroundDataSetting()
This method is deprecated. As of ICE_CREAM_SANDWICH , availability of background data depends on several combined factors, and this method will always returntrue . Instead, when background data is unavailable, getActiveNetworkInfo() will now appear disconnected.
|
NetworkInfo |