Android examples for Network:Network Operation
get Network Type Name
//package com.java2s; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; public class Main { public static String getNetworkTypeName(Context context) { String netType = ""; if (context != null) { ConnectivityManager cm = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo info = cm.getActiveNetworkInfo(); if (info != null && info.getExtraInfo() != null) { netType = info.getTypeName() + "_" + info.getExtraInfo().replace("\"", ""); }/* www . j ava2 s . c om*/ } return netType; } }