Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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;
    }
}