How to check if packet data of the mobile is connected or not. Because when I enable the mobile data option on my android app even without any load in my simcard it always connects. My problem is how to validate if the there is an internet connection or not in my android app.
btw here is my code.
ConnectivityManager cm = (ConnectivityManager)this.GetSystemService(Context.ConnectivityService);
NetworkInfo nf = cm.ActiveNetworkInfo;
if (nf != null && nf.IsConnected == true)
{
//connected
}
else
{
//not connected
}
But in this code. Even if i'm out of load. My application show i' still connected. Help Pls..