2012-03-13 2 views

답변

5
  1. 이미지를 게시하려면 Twitter4j의 미디어 확장 프로그램을 사용하고 TwitPic 또는 YFrog로 앱을 등록해야합니다.
  2. 가져 오기 KEY 및 토큰 이러한 서비스로부터는

    /* 
    * Upload File to twitPic and get url . Then append this url to your twitter message. 
    */ 
    public static String upload_twic_pic(File file) 
           throws TwitterException { 
         String url = null; 
         if (file != null) { 
        Configuration conf = new ConfigurationBuilder().setMediaProviderAPIKey(TWITPIC_KEY).build(); 
        ImageUpload upload = new ImageUploadFactory(conf).getInstance(MediaProvider.PLIXI); //Use ImageUploadFactory 
           url = upload.upload(file); 
         } 
         return url; 
    
+0

이 작동하지 않을 수 있습니다. 때문에 앱이 다운됩니다. ImageUpload upload = 새 ImageUploaderFactory (conf) .getInstance (MediaProvider.PLIXI); –

+0

Twitter4j의 Media extension jar를 추가 했습니까? 또한 추적을 게시하십시오. – kodeshpa

+0

@ user408904 ImageUpload 업로드 = 새 ImageUploadFactory (conf) .getInstance (MediaProvider.PLIXI); oauth 인증을 받으려면이 줄에 오류가 필요합니다. 도와 주실 수 있습니까? –

1

Here는 안드로이드 응용 프로그램으로 사진/텍스트 트윗을 통합하는 방법을 정확하게 설명하는 하나 개의 파일 솔루션에 대한 링크입니다.

관련 문제