Java tutorial
//package com.java2s; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; public class Main { public static String getcurrentNetworkNoWifi(Context context) { String network_type = "UNKNOWN";// maybe usb reverse tethering NetworkInfo active_network = ((ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE)) .getActiveNetworkInfo(); if (active_network != null && active_network.isConnectedOrConnecting()) { network_type = active_network.getSubtypeName(); } return network_type; } }