con.getInputStream() throw exception in Android project, how to fix?
<p><br>
con.getInputStream() throw exception, when the code running on android,
but when copy the code to regular java project it is working,<br>
The thrown object e contain "detailMessage = Permission denied".
my code::</p>

<pre><code>            public static HttpData get(String sUrl) {
                HttpData ret = new HttpData();
                String str;
                StringBuffer buff = new StringBuffer();
                try {
                        URL url = new URL(sUrl);
                        URLConnection con = url.openConnection();
                        BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
                        while ((str = in.readLine()) != null) {
                                buff.append(str);
                        }
                        ret.content = buff.toString();

                        //get headers
                        Map&lt;String, List&lt;String&gt;&gt; headers = con.getHeaderFields();
                        Set&lt;Entry&lt;String, List&lt;String&gt;&gt;&gt; hKeys = headers.entrySet();
                        for (Iterator&lt;Entry&lt;String, List&lt;String&gt;&gt;&gt; i = hKeys.iterator(); i.hasNext();) {
                                Entry&lt;String, List&lt;String&gt;&gt; m = i.next();

                                Log.w("HEADER_KEY", m.getKey() + "");
                                ret.headers.put(m.getKey(), m.getValue().toString());
                                if (m.getKey().equals("set-cookie"))
                                ret.cookies.put(m.getKey(), m.getValue().toString());
                        }
                } catch (Exception e) {
                        Log.e("HttpRequest", e.toString());
                }
                return ret;
        }
</code></pre>

<p><img src="http://i.stack.imgur.com/Ms6yG.jpg" alt="con object while debug"></p>
