using tcpdump capture the network state . implement in Android.