2011-07-04 4 views
0

imgurのウェブサイトからxmlファイルのイメージを取得しようとしています。イメージをxmlファイルに入れて、アンドロイドのimgurから取得する

これは私が書かれているコードである。問題は、行があること

try { 
      HttpClient client = new DefaultHttpClient();   
      String getURL = "http://api.imgur.com/2/account/images.xml";   
      HttpGet get = new HttpGet(getURL);   
      HttpResponse responseGet = client.execute(get);   
      HttpEntity mResEntityGet = responseGet.getEntity();   
      if (mResEntityGet != null) {    
       //do something with the response    
       String content = EntityUtils.toString(mResEntityGet); 
      } 
} catch (ClientProtocolException e) {} 
} catch (IOException e) {} 

"のHttpResponse responseGet = client.execute(GET);" IOexceptionをスローします。

私はエクスプローラでURLを記述する場合、それは私に次のXML与える:私はimgurのWebサイトから画像を使用してXMLファイルを取得することができますどのように任意のアイデアを

<?xml version="1.0" encoding="utf-8" ?> 
- <error> 
    <message>This method requires authentication</message> 
    <request>/2/account/images.xml</request> 
    <method>get</method> 
    <format>xml</format> 
    <parameters /> 
    </error> 

を?

答えて

-1

を参照してくださいログイン情報を提供する必要があると思いましたImgur.com>アルバム画像Xml

https://api.imgur.com/2/album/ {ALBUM ID}

関連する問題