Andriod开发中的HTTP请求的有关问题

Andriod开发中的HTTP请求的问题
我几乎没有学过HTTP网络传输方面的知识,但由于最近的项目需求,需要用到百度的翻译API服务。
通过以下URL(附带传递参数),可以连接到百度翻译服务端,并返回一条标准JSON文本结果:
http://openapi.baidu.com/public/2.0/bmt/translate?client_id=9tdS6VTLddEQ8oo3lEk6w94M&q=today&from=auto&to=auto
我现在想在Android手机上访问这个URL,并且得到返回的JSON信息。
于是在网上找了一下HTTP编成的相关知识,写了如下的代码:

        String strUrl = "http://openapi.baidu.com/public/2.0/bmt/translate?client_id=9tdS6VTLddEQ8oo3lEk6w94M&q=today&from=auto&to=auto";
        String JSONtext = null;
        try{
            URL url = new URL(strUrl);
            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
            conn.connect();
            BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
            String line = null;
            while((line = reader.readLine()) != null){
                JSONtext = line;
            }
            reader.close();
            conn.disconnect();
        }catch (Exception e){
            e.printStackTrace();
        }
        if(JSONtext != null){
            TextView tv = (TextView)findViewById(R.id.tv);
            tv.setText(JSONtext);
        }

运行后发现执行到 conn.connect();这句就抛出异常了。
我在AndroidMainfest.xml里面也有加入下面的这句,但是还是在 conn.connect();这句就抛出异常:
<uses-permission android:name="android.permission.INTERNET" />
找了很多文章,感觉代码都是长这样的,不知道应该如何解决。

如果有可能,希望能顺便介绍一下Android/JAVA 有关HTTP方面编成的相关知识(有找过一些,但是写的都很杂乱,希望能有个整理的好一点的),谢谢~
------解决思路----------------------
引用:
Quote: 引用:

贴出错误信息,

捕获的异常是:
android.os.NetworkOnMainThreadException
e.printStackTrace();执行后却没看见Console里有任何输出。。。
访问网络的操作,android不让放在主线程,将其放在分线程即可!