Java tutorial
//package com.java2s; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; public class Main { /** * @param context * @return */ public static String getNetWorkName(Context context) { ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); if (cm == null) return "MOBILE"; NetworkInfo info = cm.getActiveNetworkInfo(); if (info != null) return info.getTypeName(); else return "MOBILE"; } }