They aren't magic numbers, they are enumerations. Just often implemented as static constants, because that is way way more efficient than a Java enumeration.
True, having an additional API to get all kinds of information about the current network is a good idea and would be nice. A patch would probably be welcome. ;) On Sat, Apr 18, 2009 at 8:36 PM, Jason Proctor <[email protected]>wrote: > > futureproofing is hard when getNetworkType() returns a magic number. > ideally there would be a getNetwork() which returned a reference to > an object which had all the good network knowledge. > > (and magic numbers are unfortunately very common throughout the Android > API.) > > > > >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. > > > -- > jason.software.particle > > > > -- 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 -~----------~----~----~----~------~----~------~--~---

