Java tutorial
//package com.java2s; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Build; public class Main { public static NetworkInfo getLanNetworkIfPossible(ConnectivityManager connMgr) { NetworkInfo result = null; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) { result = connMgr.getNetworkInfo(ConnectivityManager.TYPE_ETHERNET); } return result; } }