Android Open Source - twittah User






From Project

Back to project page twittah.

License

The source code is released under:

MIT License

If you think the Android project twittah 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 com.codepath.wangela.apps.twittah.models;
//from   www .  j  a  va 2 s. c  o m
import java.io.Serializable;

import org.json.JSONException;
import org.json.JSONObject;

import com.activeandroid.Model;
import com.activeandroid.annotation.Column;
import com.activeandroid.annotation.Table;

@Table(name = "Users")
public class User extends Model implements Serializable {
  private static final long serialVersionUID = -2028099947760397602L;
  @Column(name = "Name")
  private String name;
  @Column(name = "User_ID", index = true, unique = true, onUniqueConflict = Column.ConflictAction.REPLACE)
  private long uid;
  @Column(name = "Screenname")
  private String screenname;
  @Column(name = "Profile_Image_URL")
  private String profileImageUrl;
  @Column(name = "Description")
  private String description;
  @Column(name = "FollowingCount")
  private String followingCount;
  @Column(name = "FollowerCount")
  private String followersCount;
  @Column(name = "Location")
  private String location;


  public User() {
    super();
  }

  public String getName() {
    return name;
  }

  public long getUid() {
    return uid;
  }

  public String getScreenname() {
    return screenname;
  }

  public String getProfileImageUrl() {
    return profileImageUrl;
  }
  
  public String getDescription() {
    return description;
  }

  public String getFollowingCount() {
    return followingCount;
  }

  public String getFollowersCount() {
    return followersCount;
  }  
  
  public String getLocation() {
    return location;
  }

  // factory method User.fromJson(...)
  public static User fromJson(JSONObject object) {
    User u = new User();
    try {
      u.name = object.getString("name");
      u.uid = object.getLong("id");
      u.screenname = object.getString("screen_name");
      u.profileImageUrl = object.getString("profile_image_url");
      u.description = object.getString("description");
      u.location = object.getString("location");
      u.followingCount = object.getString("friends_count");
      u.followersCount = object.getString("followers_count");
    } catch (JSONException e) {
      e.printStackTrace();
      return null;
    }
    return u;
  }

}




Java Source Code List

com.codepath.wangela.apps.twittah.activities.ComposeActivity.java
com.codepath.wangela.apps.twittah.activities.LoginActivity.java
com.codepath.wangela.apps.twittah.activities.ProfileActivity.java
com.codepath.wangela.apps.twittah.activities.TimelineActivity.java
com.codepath.wangela.apps.twittah.activities.TweetDetailActivity.java
com.codepath.wangela.apps.twittah.activities.TwitterApplication.java
com.codepath.wangela.apps.twittah.adapters.TweetArrayAdapter.java
com.codepath.wangela.apps.twittah.fragments.HomeTimelineFragment.java
com.codepath.wangela.apps.twittah.fragments.MentionsTimelineFragment.java
com.codepath.wangela.apps.twittah.fragments.TweetsListFragment.java
com.codepath.wangela.apps.twittah.fragments.UserTimelineFragment.java
com.codepath.wangela.apps.twittah.helpers.TwitterClient.java
com.codepath.wangela.apps.twittah.listeners.EndlessScrollListener.java
com.codepath.wangela.apps.twittah.listeners.SupportFragmentTabListener.java
com.codepath.wangela.apps.twittah.models.Category.java
com.codepath.wangela.apps.twittah.models.Item.java
com.codepath.wangela.apps.twittah.models.SampleModel.java
com.codepath.wangela.apps.twittah.models.Tweet.java
com.codepath.wangela.apps.twittah.models.User.java