Android Open Source - AndroidTwitterApp User






From Project

Back to project page AndroidTwitterApp.

License

The source code is released under:

MIT License

If you think the Android project AndroidTwitterApp 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 net.julienlecomte.apps.basictwitter.models;
//  w w  w  .jav a2 s.  co  m
import org.json.JSONException;
import org.json.JSONObject;

public class User {
  private long uid;
  private String name;
  private String screenName;
  private String imageProfileUrl;
  private long followersCount;
  private long friendsCount;
  private String description;

  public long getUid() {
    return uid;
  }

  public String getName() {
    return name;
  }

  public String getScreenName() {
    return screenName;
  }

  public String getImageProfileUrl() {
    return imageProfileUrl;
  }

  public long getFollowersCount() {
    return followersCount;
  }

  public long getFriendsCount() {
    return friendsCount;
  }

  public String getDescription() {
    return description;
  }

  public static User fromJson(JSONObject jsonObject) {
    User user = new User();

    try {
      user.uid = jsonObject.getLong("id");
      user.name = jsonObject.getString("name");
      user.screenName = jsonObject.getString("screen_name");
      user.imageProfileUrl = jsonObject.getString("profile_image_url");
      user.followersCount = jsonObject.getInt("followers_count");
      user.friendsCount = jsonObject.getInt("friends_count");
      user.description = jsonObject.getString("description");
      
    } catch (JSONException e) {
      e.printStackTrace();
      return null;
    }

    return user;
  }
}




Java Source Code List

net.julienlecomte.apps.basictwitter.ComposeActivity.java
net.julienlecomte.apps.basictwitter.EndlessScrollListener.java
net.julienlecomte.apps.basictwitter.LoginActivity.java
net.julienlecomte.apps.basictwitter.ProfileActivity.java
net.julienlecomte.apps.basictwitter.TimelineActivity.java
net.julienlecomte.apps.basictwitter.TweetArrayAdapter.java
net.julienlecomte.apps.basictwitter.TwitterApp.java
net.julienlecomte.apps.basictwitter.TwitterClient.java
net.julienlecomte.apps.basictwitter.fragments.HomeTimelineFragment.java
net.julienlecomte.apps.basictwitter.fragments.MentionsTimelineFragment.java
net.julienlecomte.apps.basictwitter.fragments.TweetsListFragment.java
net.julienlecomte.apps.basictwitter.fragments.UserTimelineFragment.java
net.julienlecomte.apps.basictwitter.listeners.FragmentTabListener.java
net.julienlecomte.apps.basictwitter.models.Tweet.java
net.julienlecomte.apps.basictwitter.models.User.java