私は多くの検索をしていますが、依然として答えは得られません。 TwitterのOAuthを持つカスタムメッセージとし、TwitPicのを使用しないTwitterで写真をツイートする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で写真をアップロードするためにこれを使用しています。
お楽しみください。 :)
ありがとうございました。
私は同じものを使用していましたが、正しいものであってもINVALID USERNAME&PASSWARDというメッセージが表示されます。 –
@Amandeepsingh:私の場合はうまくいきますが、答えを更新しましょう。 。 。 –
@Amandeepsingh:更新された回答を確認してください。あらゆる場合に機能します。 –