Android Open Source - allblue-all-in-one Twitter Account






From Project

Back to project page allblue-all-in-one.

License

The source code is released under:

MIT License

If you think the Android project allblue-all-in-one listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.allblue.metadata;
//from  w  w  w .ja v  a 2 s .  co m
import org.json.JSONException;
import org.json.JSONObject;

public class TwitterAccount extends Account {
  public TwitterAccount() {}

  protected TweetItem parseTweetJSONObject(JSONObject tweetJSONObj) {
    try {
      
      String tweetId = tweetJSONObj.getString("id");
      
      String text = tweetJSONObj.getString("text");
  
      JSONObject user = tweetJSONObj.getJSONObject("user");
      
      String name = user.getString("name");
      
      String screenName = user.getString("screen_name");
      
      String userId = user.getString("id");
      
      String profileImageUrl = user.getString("profile_image_url");
      
      String location = user.getString("location");
      
      
      String createAt = tweetJSONObj.getString("created_at");
      
      String inReplyToUserId = tweetJSONObj.getString("in_reply_to_user_id") == null ? tweetJSONObj.getString("in_reply_to_user_id") : "-1";
      
      String inReplyToScreenName = tweetJSONObj.getString("in_reply_to_screen_name");
      
      String source = tweetJSONObj.getString("source");
      
      String inReplyToStatusId = tweetJSONObj.getString("in_reply_to_status_id") == null ? tweetJSONObj.getString("in_reply_to_status_id") : "-1";
      
      
      return new TweetItem.Builder(Long.valueOf(tweetId), Long.valueOf(userId), name, screenName, text)
          .createAt(createAt).inReplyToScreenName(inReplyToScreenName).inReplyToStatusId(Long.valueOf(inReplyToStatusId))
          .inReplyToUserId(Long.valueOf(inReplyToUserId)).location(location).source(source).profileImageUrl(profileImageUrl)
          .build();
      
    } catch (JSONException e) {
      e.printStackTrace();
    }
    return null;
  }
}




Java Source Code List

org.allblue.DashBoard.java
org.allblue.activity.GlobalActivity.java
org.allblue.activity.HomeActivity.java
org.allblue.activity.OAuthActivity.java
org.allblue.activity.SettingActivity.java
org.allblue.activity.SingleTabActivity.java
org.allblue.adapter.SettingAdapter.java
org.allblue.adapter.SingleTabCursorAdapter.java
org.allblue.database.DatabaseConfig.java
org.allblue.database.DatabaseHelper.java
org.allblue.metadata.AccountTypes.java
org.allblue.metadata.Account.java
org.allblue.metadata.SinaAccount.java
org.allblue.metadata.TweetItem.java
org.allblue.metadata.TwitterAccount.java
org.allblue.util.OAuthUtil.java
org.allblue.util.SharedOAuthToken.java
org.allblue.util.XMLUtil.java