package iku.os.net;
import android.content.Context;
import android.net.ConnectivityManager;
//import android.net.NetworkInfo;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;

public class NetWorkUtils {

    private static final String TAG = "NetWorkUtils";


    public static final int APNTYPE_NONE = 0;
    public static final int APNTYPE_WIFI = 1;
    public static final int APNTYPE_WAP = 2;
    public static final int APNTYPE_NET = 3;


    /**
     * 检查是否有wifi网络
     *
     * @param context
     * @return
     */

    public static HttpURLConnection getHttpURLConnection(Context context,
                                                         String _url) throws IOException {
        return getHttpURLConnection(context, _url, false);
    }

    private static int dynamicPort0 = 20380;
    private static int dynamicPort = dynamicPort0;
    private static int dynamicPort1 = 30379;

    public static HttpURLConnection getHttpURLConnection(Context context, String _url, boolean isProxy) throws IOException {
        URL url = new URL(_url);

        HttpURLConnection httpUrlConnection = null;

        httpUrlConnection = (HttpURLConnection)url.openConnection();
        return httpUrlConnection;
    }

}
