thanks Kostya Vasilyev,

                                   I tried like this

       void chkStatus()
    {
    final ConnectivityManager connMgr = (ConnectivityManager)
    this.getSystemService(Context.CONNECTIVITY_SERVICE);

    final android.net.NetworkInfo wifi =
    connMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI);

    final android.net.NetworkInfo mobile =
    connMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);

    if( wifi.isConnected() ){

    Toast.makeText(this, "Wifi" , Toast.LENGTH_LONG).show();
    }
    else if( mobile.isAvailable() ){
    Toast.makeText(this, "Mobile 3G " , Toast.LENGTH_LONG).show();
    }
    else
    {Toast.makeText(this, "No Network " , Toast.LENGTH_LONG).show();}
    }


my problem is in my mobile wifi is on but there is no network..it's showing
wifi in the toast..
i want to show if no network is there then there is a toast which represents
no network.
Thanks in advance.

Regards,
Abhilash



2010/12/21 Kostya Vasilyev <kmans...@gmail.com>

> ConnectivityManager (look it up in the sdk reference).
>
> --
> Kostya Vasilyev -- http://kmansoft.wordpress.com
> 21.12.2010 15:35 пользователь "Abhilash baddam" <
> abhilash.androiddevelo...@gmail.com> написал:
>
> > Hi friends,
> >
> > How can we know programmatically whether the mobile is
> > connected to internet or not either by mobile network or wifi.
> >
> >
> >
> >
> >
> >
> > Regards,
> > Abhilash
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> > For more options, visit this group at
> > http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to