This is a sample observes changes of network state and of wifi state for Android.