I know how to check for internet connectivity when my app is open using activity. But how to check for connectivity in service when my app is not running?
The system provides a Broadcast when the network connectivity changes, which you can read using a BroadcastReceiver. This will be called whether your app is open or closed.