title: How to build url in java?
body: <p>I am building a String with StringBuilder</p>
  
  <pre><code>StringBuilder builder = new StringBuilder();
  builder.append("my parameters");
  builder.append("other parameters");
  </code></pre>
  
  <p>Then i build a Url</p>
  
  <pre><code>Url url = new Url(builder.toString());
  </code></pre>
  
  <p>And then i try the connection</p>
  
  <pre><code>HttpURLConnection connection = (HttpURLConnection) url.openConnection();
  </code></pre>
  
  <p>But the url seems not to be right from the results i get. It's like some parameter is being false passed. That's why i think the problem is in the part of the StringBuilder.</p>
  
  <p>The problem is in a double parameter i try to pass.</p>
  
  <pre><code>double longitude = 23.433114;
  String lng = String.ValueOf(longitude);
  </code></pre>
  
  <p>And then i put it in the url.
  But if i give it as a string the result is correct.</p>
  
  <pre><code>String lng = "23.433114"
  </code></pre>
  
  <p>Is UrlEncoding necessary? I will try what is suggested below.</p>