2011-12-14 105 views

回答

0

那麼我有搜索許多,但仍然沒有得到答案,因爲我想。

最後我用這個在Twitter上的照片上傳與自定義消息:

File picture = new File(APP_FILE_PATH + "/"+filename+".jpg"); 
    // Create TwitPic object and allocate TwitPicResponse object 
    TwitPic tpRequest = new TwitPic(TWITTER_NAME, TWITTER_PASSWORD); 
    TwitPicResponse tpResponse = null; 
    // Make request and handle exceptions        
    try {   
    tpResponse = tpRequest.uploadAndPost(picture, customMessageEditText.getText()+" http://www.MySite.com/"); 

    } 
    catch (IOException e) {   
     e.printStackTrace(); 
    } 
    catch (TwitPicException e) {   
    e.printStackTrace(); 
    } 
    // If we got a response back, print out response variables        
    if(tpResponse != null) {   
     tpResponse.dumpVars(); 
     System.out.println(tpResponse.getStatus()); 
     if(tpResponse.getStatus().equals("ok")){ 

     Toast.makeText(getApplicationContext(), "Photo posted on Twitter.",Toast.LENGTH_SHORT).show(); 

    } 
} 

仍然在搜索Twitter的演示的鳴叫圖片在Twitter上與Twitter的OAuth的和不使用twitPic自定義消息。

享受。 :)

謝謝。

+0

我曾經使用過,但它顯示我的信息INVALID USERNAME&PASSWARD,即使它是正確的。 – 2012-03-31 07:50:21

相關問題