Skip to content

How to check Internet Connection in Background continuously even if App is Running or Not/Closed.. #470

Description

@patelakshay13890

How Check Internet Connection in Broadcast Receiver or Service Like as we do in Activity ?
But I need in Service or Broadcast Receiver..
Means I need to check Internet Connation in Background continuously even if App is Running or Not/Closed..
As on Internet Connectivity change I want to Sync My Data to Server so please help me out..!!
Thanks..

Activity

  1. pwittchen commented on Feb 1, 2023

    @pwittchen
    Owner

    Hi @patelakshay13890,

    This library is designed to be used while app is running and active. If the Activity is inactive (in background) then library should not detect changes and it should start detecting connectivity changes again when app is active (in foreground) again.

    If you want to use library when app is inactive (in the background), then you should create an Android Service and then use it inside Service. Of course, you need to dispose appropriate subscription/disposable, when Service is being closed or destroyed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions