Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.os.Build;

public class Main {
    /**
     * A bug in Android OS prior to Froyo forbids the usage of http.keepAlive as closing a
     * connection input stream would poison the connection pool.
     */
    static void disableConnectionReuseIfNecessary() {
        // HTTP connection reuse which was buggy pre-froyo
        if (Integer.parseInt(Build.VERSION.SDK) < 8) {
            System.setProperty("http.keepAlive", "false");
        }
    }
}