2011-12-14 55 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

相关问题