Code example for ProtocolVersion

0
        if (httpclient == null) {
            DefaultHttpClient client = new DefaultHttpClient();
            ClientConnectionManager mgr = client.getConnectionManager();
            HttpParams params = client.getParams();
            httpclient = new DefaultHttpClient(new ThreadSafeClientConnManager(params, mgr.getSchemeRegistry()), params);
            httpclient.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, new ProtocolVersion("HTTP", 1, 1));
        } 
        return httpclient;
    } 
 
    public static void setMyLocation(GeoPoint myLocation_) {
        myLocation = myLocation_;
    } 
 
    private static String getMyLocationString() {
        String myLocationString = "";
        if (myLocation != null) {
            try { 
                myLocationString = "&" + URLEncoder.encode("longitude", "UTF-8") + "=" + URLEncoder.encode(Double.toString(myLocation.getLongitudeE6() / 10000000), "UTF-8") +
                        "&" + URLEncoder.encode("latitude", "UTF-8") + "=" + URLEncoder.encode(Double.toString(myLocation.getLatitudeE6() / 1000000), "UTF-8");
Experience pair programming with AI  Get Codota for Java