Android 通过HttpClient连接到web服务器

Android 通过HttpClient连接到web服务器,android,rest,httpclient,Android,Rest,Httpclient,我正在尝试连接到RESTWeb服务器,我不知道出了什么问题。连接的代码是: public List<Agenda> getAgenda(String dia) { try { Log.i(TAG, "It is inside getAgenda()"); HttpClient client = new DefaultHttpClient(); HttpGet method = new HttpGet(Settings.getSe

我正在尝试连接到RESTWeb服务器,我不知道出了什么问题。连接的代码是:

public List<Agenda> getAgenda(String dia) {
    try {
        Log.i(TAG, "It is inside getAgenda()");
        HttpClient client = new DefaultHttpClient();
        HttpGet method = new HttpGet(Settings.getServiceUrl() + "/" + dia);
        Log.i(TAG, Settings.getServiceUrl() + "/" + dia);
        //the line above prints: http://192.168.0.100/odonto/agenda.php/2012-02-01
        HttpResponse resp = client.execute(method);
        //return loadFromJSONArray(client.execute(method));
        Log.i(TAG, "Recebeu a response");
        return loadFromJSONArray(resp);
    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }
}
在调试窗口上正确打印。但是这句话:

Log.i(TAG, "Recebeu a response");
不要打印。因此,问题在于:

HttpResponse resp = client.execute(method);
但我真的不知道这怎么可能是错的!!我已经用Firefox测试了REST服务器,它工作得很好!链接中有一个调试窗口,该窗口带有一个仅显示标记System.err的过滤器:


您遇到权限拒绝错误。请在应用程序标记后在menifest文件中添加以下权限

 <uses-permission android:name="android.permission.INTERNET"/>

我添加了这行代码,效果很好!!它有其他错误,但连接正在工作。谢谢。。。
 <uses-permission android:name="android.permission.INTERNET"/>