Package 

Interface NetworkStateObserver


  • 
    public interface NetworkStateObserver
    
                        

    Contract for observing device network connectivity state. Implementations track online/offline transitions and notify registered listeners.

    Typical lifecycle: obtain via ServiceLocator -> start -> add/remove listeners -> stop. isOnline may be called at any time; before start it reflects a one-time system query.

    • Method Detail

      • isOnline

         abstract Boolean isOnline()

        Returns the current connectivity state. After start is called, this value is kept up-to-date reactively.

      • start

         abstract Unit start()

        Begins observing connectivity changes. Idempotent — subsequent calls are no-ops. Must be paired with stop to prevent resource leaks.

      • stop

         abstract Unit stop()

        Stops observing and releases all system callbacks/receivers. Idempotent — safe to call even if not started.