1

Time has come to learn how to implement a broadcast receiver for the first time. :)

I found this great example for a WiFi Scan broadcast receiver, but that's too WiFi detail oriented. All I need is a Boolean notification that tells me whether any active network has been found.

Is there a particular such broadcast?

Is there a compilation/list of all system generated broadcasts?

Community
  • 1
  • 1
ateiob
  • 9,016
  • 10
  • 44
  • 55
  • 1
    This might help http://stackoverflow.com/questions/4238921/android-detect-whether-there-is-an-internet-connection-available – Zerhinne Sep 13 '11 at 03:25
  • @androidnoob Thanks +1. The link you brought is very helpful, but if I understand correctly, it could only be used for *polling*. What I am interested in is some kind of listener or broadcast receiver sits idle until waken up by the event. Do you think [this one](http://stackoverflow.com/questions/6179906/how-can-i-receive-a-notification-when-the-device-loses-network-connectivity) can do? – ateiob Sep 13 '11 at 03:48

1 Answers1

3

See this and this

In case the pages pointed by the links ever goes down, here is the key:

register a BroadcastReciver with action ConnectivityManager.CONNECTIVITY_ACTION.

Community
  • 1
  • 1
Varun
  • 33,833
  • 4
  • 49
  • 42