6.3.1.9.18. NetworkUtil

public class NetworkUtil

6.3.1.9.18.1. Fields

6.3.1.9.18.1.1. ERROR_AUTH

public static final int ERROR_AUTH

6.3.1.9.18.1.2. ERROR_CONNECT_FAILED

public static final int ERROR_CONNECT_FAILED

6.3.1.9.18.1.3. ERROR_DOWNLOAD_DATA

public static final int ERROR_DOWNLOAD_DATA

6.3.1.9.18.1.4. ERROR_NETWORK_UNAVAILABLE

public static final int ERROR_NETWORK_UNAVAILABLE

6.3.1.9.18.1.5. HTTP_DELETE

public static final String HTTP_DELETE

6.3.1.9.18.1.6. HTTP_GET

public static final String HTTP_GET

6.3.1.9.18.1.7. HTTP_POST

public static final String HTTP_POST

6.3.1.9.18.1.8. HTTP_PUT

public static final String HTTP_PUT

6.3.1.9.18.1.9. TIMEOUT_CONNECTION

public static final int TIMEOUT_CONNECTION

6.3.1.9.18.1.10. TIMEOUT_SOCKET

public static final int TIMEOUT_SOCKET

6.3.1.9.18.1.11. mConnectionManager

protected final ConnectivityManager mConnectionManager

6.3.1.9.18.1.12. mContext

protected Context mContext

6.3.1.9.18.1.13. mLastCheckTime

protected long mLastCheckTime

6.3.1.9.18.1.14. mLastState

protected boolean mLastState

6.3.1.9.18.1.15. mTelephonyManager

protected final TelephonyManager mTelephonyManager

6.3.1.9.18.2. Constructors

6.3.1.9.18.2.1. NetworkUtil

public NetworkUtil(Context context)

6.3.1.9.18.3. Methods

6.3.1.9.18.3.1. delete

public static HttpResponse delete(String targetURL, String username, String password, boolean readErrorResponseBody)

6.3.1.9.18.3.2. get

public static HttpResponse get(String targetURL, String username, String password, boolean readErrorResponseBody)

6.3.1.9.18.3.3. getError

public static String getError(Context context, int responseCode)

6.3.1.9.18.3.4. getHTTPBaseAuth

public static String getHTTPBaseAuth(String username, String password)

6.3.1.9.18.3.5. getHttpConnection

public static HttpURLConnection getHttpConnection(String method, String targetURL, String username, String password)

6.3.1.9.18.3.6. getHttpResponse

protected static HttpResponse getHttpResponse(HttpURLConnection conn, boolean readErrorResponseBody)

6.3.1.9.18.3.7. getStream

public static void getStream(String targetURL, String username, String password, OutputStream outputStream)

6.3.1.9.18.3.8. isNetworkAvailable

public synchronized boolean isNetworkAvailable()

6.3.1.9.18.3.9. post

public static HttpResponse post(String targetURL, String payload, String username, String password, boolean readErrorResponseBody)

6.3.1.9.18.3.10. postFile

public static HttpResponse postFile(String targetURL, String fileName, File file, String fileMime, String username, String password, boolean readErrorResponseBody)

6.3.1.9.18.3.11. put

public static HttpResponse put(String targetURL, String payload, String username, String password, boolean readErrorResponseBody)

6.3.1.9.18.3.12. responseToString

public static String responseToString(InputStream is)