예제 #1
0
 public static void pubSoftWareTweet(Tweet tweet, int softid, AsyncHttpResponseHandler handler) {
   RequestParams params = new RequestParams();
   params.put("uid", tweet.getAuthorid());
   params.put("msg", tweet.getBody());
   params.put("project", softid);
   ApiHttpClient.post("action/api/software_tweet_pub", params, handler);
 }
예제 #2
0
  public static void pubTweet(Tweet tweet, AsyncHttpResponseHandler handler) {
    RequestParams params = new RequestParams();
    params.put("uid", tweet.getAuthorid());
    params.put("msg", tweet.getBody());

    // Map<String, File> files = new HashMap<String, File>();
    if (!TextUtils.isEmpty(tweet.getImageFilePath())) {
      try {
        params.put("img", new File(tweet.getImageFilePath()));
      } catch (FileNotFoundException e) {
        e.printStackTrace();
      }
    }
    if (!TextUtils.isEmpty(tweet.getAudioPath())) {
      try {
        params.put("amr", new File(tweet.getAudioPath()));
      } catch (FileNotFoundException e) {
        e.printStackTrace();
      }
    }
    ApiHttpClient.post("action/api/tweet_pub", params, handler);
  }