URISyntaxException in android
<p>I have a problem that I want to parse a URL with JSON data. When I want to get data from that URL then it shows URISyntaxException but the same URL is running absolutely fine on the browser. I don't know why it returns the same error while it runs on a browser. Please suggest me any solution regarding the same.</p>

<p><strong>Logcat:</strong></p>

<pre><code>05-10 21:26:21.465: W/System.err(379): java.net.URISyntaxException: Illegal character in query at index 159: http://apibeta.highgearmedia.com/v1/vehicles/get-make-models.json?sort=mpg&amp;to=&amp;filter=category&amp;client-id=10030812&amp;from=coupe&amp;signature=pqSBdOzE5-bgUf1V61UGFQ==
05-10 21:26:21.475: W/System.err(379):  at java.net.URI.validateQuery(URI.java:434)
05-10 21:26:21.475: W/System.err(379):  at java.net.URI.parseURI(URI.java:340)
05-10 21:26:21.475: W/System.err(379):  at java.net.URI.&lt;init&gt;(URI.java:72)
05-10 21:26:21.486: W/System.err(379):  at com.TCC.android.ResearchList.getJsonSring(ResearchList.java:3891)
05-10 21:26:21.486: W/System.err(379):  at com.TCC.android.ResearchList$67.run(ResearchList.java:4069)
05-10 21:26:23.004: W/InputManagerService(60): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@406b8b78
</code></pre>

<p><strong>Code:</strong></p>

<pre><code>HttpClient client = new DefaultHttpClient();
            HttpGet request = new HttpGet();
            request.setURI(new URI(url));//===&gt; This line returns an error
            HttpResponse response = client.execute(request);
            InputStream ips = response.getEntity().getContent();
            BufferedReader buf = new BufferedReader(new InputStreamReader(ips,
                    "UTF-8"));

            StringBuilder sb = new StringBuilder();
            String s;
            while (true) {
                s = buf.readLine();
                if (s == null || s.length() == 0)
                    break;
                sb.append(s);

            }
            buf.close();
            ips.close();
            return sb.toString();
</code></pre>

<p>Thanks in advance.</p>
