how to mange wifi internet connectivity in android?
<p>i use following code to check 3g,edge connectivity in android phone application</p>

<pre><code>public boolean isConnected()
    {
        try
        {
            final ConnectivityManager conn_manager = (ConnectivityManager) 
            this.getSystemService(Context.CONNECTIVITY_SERVICE);

            final NetworkInfo network_info = conn_manager.getActiveNetworkInfo();
            if ( network_info != null &amp;&amp; network_info.isConnected() ) 
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        catch (Exception e) 
        {
            return false;

        }
    }
</code></pre>

<p>if i connect it to wifi then this check does not work correctly
actually when wifi is connected to network and internet coverage is not there above check say ok infact its wrong  any one guide me how to handle packet lost case like</p>

<p>internet comming then disconnnecting and this process keeps continue in android ?
or am i doing something wrong?</p>

<p>any help would be appreciated.</p>
