Thanks for this. Wouldn't EDGE be considered 2g though? Or maybe 2.5? On Nov 9, 4:06 pm, String <[email protected]> wrote: > FYI, the DROID user tells me I've got it fixed now. What I did was to > include every subtype which isn't pure 2G in my test: > > ((netSubtype == TelephonyManager.NETWORK_TYPE_UMTS) || > (netSubtype == TelephonyManager.NETWORK_TYPE_1xRTT) || > (netSubtype == TelephonyManager.NETWORK_TYPE_EDGE) || > (netSubtype == TelephonyManager.NETWORK_TYPE_EVDO_0) || > (netSubtype == TelephonyManager.NETWORK_TYPE_EVDO_A) || > (netSubtype == TelephonyManager.NETWORK_TYPE_HSDPA) || > (netSubtype == TelephonyManager.NETWORK_TYPE_HSPA) || > (netSubtype == TelephonyManager.NETWORK_TYPE_HSUPA))) > > Hope that helps someone, > > String > > On Nov 9, 7:06 pm, String <[email protected]> wrote: > > > > > I'm getting a user error report that my app thinks their DROID handset > > isn't connected to 3G, and after getting a logfile from him I think > > I've narrowed it down to the return value from NetworkInfo.getSubtype > > (). The code in question is the following, based on Jeff Sharkey's I/O > > 2009 talk "Coding for Battery Life" (see Slide 10 > > athttp://dl.google.com/io/2009/pres/W_0300_CodingforLife-BatteryLifeTha...). > > > NetworkInfo networkInfo = CONN_MGR.getActiveNetworkInfo(); > > int netType = networkInfo.getType(); > > int netSubtype = networkInfo.getSubtype(); > > if (netType == ConnectivityManager.TYPE_WIFI) { > > // Wifi connection > > connected = true; > > } else if ((netType == ConnectivityManager.TYPE_MOBILE) && > > (netSubtype == TelephonyManager.NETWORK_TYPE_UMTS) && > > !TEL_MGR.isNetworkRoaming()) { > > // 3G connection > > connected = true; > > } > > > My strong suspicion is the check against > > TelephonyManager.NETWORK_TYPE_UMTS, that either Verizon or DROID is > > returning a different value for its 3G network. My guess is either > > NETWORK_TYPE_EVDO_0 or NETWORK_TYPE_EVDO_A, but I'd like to have more > > than a guess here. Anyone have direct knowledge, or a better position > > to guess from? > > > I know Jeff often monitors this group. Jeff, any suggestions, given > > this was your code to start with? ;^) > > > Thanks, > > > String- Hide quoted text - > > - Show quoted text -
-- 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

