MCPcopy Create free account
hub / github.com/Freelander/Android_Data / is3rd

Method is3rd

fake_land/NetworkUtils.java:57–66  ·  view source on GitHub ↗

判断是否是3G网络 @param context @return

(Context context)

Source from the content-addressed store, hash-verified

55 * @return
56 */
57 public static boolean is3rd(Context context) {
58 ConnectivityManager cm = (ConnectivityManager) context
59 .getSystemService(Context.CONNECTIVITY_SERVICE);
60 NetworkInfo networkINfo = cm.getActiveNetworkInfo();
61 if (networkINfo != null
62 && networkINfo.getType() == ConnectivityManager.TYPE_MOBILE) {
63 return true;
64 }
65 return false;
66 }
67
68 /**
69 * 判断是wifi还是3g网络

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected