# Class NetworkTypePlatform

java.lang.Object
com.codename1.io.NetworkTypePlatform

public class NetworkTypePlatform extends java.lang.Object

Platform-supplied implementation of the network-type tracking API. `NetworkManager.getCurrentNetworkType()`, `NetworkManager.addNetworkTypeListener(...)` and the matching remover all dispatch through this.

Part of the framework's service-provider interface, not intended for application use.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NetworkTypePlatform()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getCurrentNetworkType()`
  One of the `NetworkManager.NETWORK_TYPE_*` constants.
  `void`
  `install(NetworkManager target)`
  Subscribe to platform network transitions.
  `void`
  `uninstall(NetworkManager target)`
  Tear down the watcher installed by `install`.

  ### Methods inherited from class java.lang.Object

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

- ## Constructor Details

  - ### NetworkTypePlatform

    public NetworkTypePlatform()

- ## Method Details

  - ### getCurrentNetworkType

    public int getCurrentNetworkType()
    One of the `NetworkManager.NETWORK_TYPE_*` constants. Default returns `NETWORK_TYPE_OTHER` when an access point is configured so stub platforms still indicate "some connectivity present".

  - ### install

    public void install(NetworkManager target)
    Subscribe to platform network transitions. The platform must call `target.fireNetworkTypeChange(newType, vpnActive)` whenever the active network changes. Default is a no-op for platforms that can't observe transitions.

  - ### uninstall

    public void uninstall(NetworkManager target)
    Tear down the watcher installed by `install`. Default no-op.