Keep in mind that in the future there will be other network types, such as
on CDMA devices in the near future, and whatever new cell network protocols
appear even later.  Depending on comparing against a fixed set of types is
not robust.

On Sat, Apr 18, 2009 at 4:11 PM, Moto <[email protected]> wrote:

>
> How about you use:
>
> TelephonyManager c=(TelephonyManager) Context.getSystemService
> (Context.TELEPHONY_SERVICE);
>
>                switch (c.getNetworkType())
>                {
>                case TelephonyManager.NETWORK_TYPE_UNKNOWN:
>                        Log.i("CONNECTION", "UNKNOWN");
>                        break;
>                case TelephonyManager.NETWORK_TYPE_EDGE:
>                        Log.i("CONNECTION", "EDGE");
>                        break;
>                case TelephonyManager.NETWORK_TYPE_GPRS:
>                        Log.i("CONNECTION", "GPRS");
>                        break;
>                case TelephonyManager.NETWORK_TYPE_UMTS:
>                        Log.i("CONNECTION", "UMTS");
>                        break;
>                }
>
> might do the trick ;)
>
> Moto!
> >
>


-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

Reply via email to