NetworkMonitor

tee3.webrtc

## 类 NetworkMonitor

- java.lang.Object
- - tee3.webrtc.NetworkMonitor

-     public class NetworkMonitor
      extends java.lang.Object

  Borrowed from Chromium's src/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java

  Triggers updates to the underlying network state from OS networking events.

  This class is thread-safe.

- - ### 嵌套类概要

    嵌套类
    限定符和类型 | 类和说明
    --- | ---
    `static interface` | `NetworkMonitor.NetworkObserver` Alerted when the connection type of the network changes.

  - ### 方法概要

    所有方法 静态方法 实例方法 具体方法 已过时的方法
    限定符和类型 | 方法和说明
    --- | ---
    `static void` | `addNetworkObserver(NetworkMonitor.NetworkObserver observer)` 已过时。 Use permissionHelper(appContext).addObserver instead.
    `void` | `addObserver(NetworkMonitor.NetworkObserver observer)`
    `static NetworkMonitor` | `getInstance()` Returns the singleton instance.
    `static void` | `init(android.content.Context context)` 已过时。
    `static boolean` | `isOnline()` Checks if there currently is connectivity.
    `static void` | `removeNetworkObserver(NetworkMonitor.NetworkObserver observer)` 已过时。 Use permissionHelper(appContext).removeObserver instead.
    `void` | `removeObserver(NetworkMonitor.NetworkObserver observer)`
    `void` | `startMonitoring()` 已过时。
    `void` | `startMonitoring(android.content.Context applicationContext)` Enables auto detection of the network state change and brings up mobile networks for using multi-networking.
    `void` | `stopMonitoring()` Stop network monitoring.

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 方法详细资料

    - #### init

          @Deprecated
          public static void init(android.content.Context context)

      已过时。

    - #### getInstance

          public static NetworkMonitor getInstance()

      Returns the singleton instance. This may be called from native or from Java code.

    - #### startMonitoring

          public void startMonitoring(android.content.Context applicationContext)

      Enables auto detection of the network state change and brings up mobile networks for using multi-networking. This requires the embedding app have the platform ACCESS_NETWORK_STATE and CHANGE_NETWORK_STATE permission.

    - #### startMonitoring

          @Deprecated
          public void startMonitoring()

      已过时。
      Deprecated, pass in application context in startMonitoring instead.

    - #### stopMonitoring

          public void stopMonitoring()

      Stop network monitoring. If no one is monitoring networks, destroy and reset autoDetect.

    - #### addNetworkObserver

          @Deprecated
          public static void addNetworkObserver(NetworkMonitor.NetworkObserver observer)

      已过时。 Use permissionHelper(appContext).addObserver instead.
      Adds an observer for any connection type changes.

    - #### addObserver

          public void addObserver(NetworkMonitor.NetworkObserver observer)

    - #### removeNetworkObserver

          @Deprecated
          public static void removeNetworkObserver(NetworkMonitor.NetworkObserver observer)

      已过时。 Use permissionHelper(appContext).removeObserver instead.
      Removes an observer for any connection type changes.

    - #### removeObserver

          public void removeObserver(NetworkMonitor.NetworkObserver observer)

    - #### isOnline

          public static boolean isOnline()

      Checks if there currently is connectivity.