Individual Assignment 4

From CS1635 Spring 2014
Jump to: navigation, search

Deadline: by 9:00AM on April 10, 2014.

Contents

Overview

  • You will create a Twitter client for Android.
  • You will learn how to add third-party libraries to your applications, and how to work with threading in Android.
  • You will submit your source, executable, and a brief description about major challenges you addressed or lessons learned from this assignment.
  • This assignment is worth 30 points, with up to 5 extra credit points.

Requirements

Your application must have the following functionality:

  • Show the user's home timeline (the list of recent tweets of all people you follow - this is the equivalent of twitter.com/# on the Twitter website.)
  • Show the list of tweets that mention the user (this is the equivalent of twitter.com/#!/mentions on the Twitter website).
  • Each tweet should show the originating user, the tweet itself, and when it was posted.
  • Open the URLs inside tweets in the browser.
  • Post new tweets.
  • View information about tweet authors: username, name, number of tweets, number of followers, number of followees.
  • Enable the user to refresh all lists of tweets.
  • These functions only have to work for your own user account, which you can hard-code into the source (authenticating for other users is complicated and tangential to UI design).
  • Your app must be designed well: It should follow usability guidelines such as Nielsen's 10 heuristics.
  • There are many open source Android twitter clients on the internet. You cannot use them for your homework assignment. You can use some of the open source third party UI widgets in your assignment, but you must acknowledge them in your descriptions.

Extra Credit Options

You may add extra features or design choices that make your app more useful or aesthetically pleasing. You can receive a maximum of 5 extra credit points in total. Below are some suggestions (no more than 5 extra points in total):

  • Add user profile images to their tweets (1 pt).
  • Add search, e.g., for hashtags (0-2 pts, depending on implementation).
  • Add the ability to follow or unfollow users. (0-2 pts, depending on implementation).
  • Add the ability to change the user's personal information. (0-2pts, depending on implementation).
  • Add support for direct messaging (0-3pts, depending on implementation).
  • Instead of using a hard-coded user account, enable users to provide their username and login inside the application. This requires switching from single token authentication to oAuth. This is relatively hard and painful. (3pts if done well).

Grading Guidelines

  • Up to 20 points for the technical implementation.
  • Up to 10 points for the overall design and usability of the application.

Instructions and Hints

Strategy

This is the largest individual application design and implementation assignment. Use the design process we have discussed in class: first think about the interaction design and make a functional prototype, then worry about how to tie in with the Twitter API.

There are many examples of Twitter applications for any mobile or desktop platform that you can use for inspiration. Download and test a few of them to inform your own design.

Twitter Account Setup

  • You need a personal Twitter account for this assignment. You can use the account you already have, or sign up for a new account at twitter.com/signup.
  • To show useful data in your home timeline, you must follow some other users. You might want to follow @jnd1er, the timeline of Donald Norman, the author of Design of everyday things.
  • To access the Twitter API, you must register a Twitter new application at dev.twitter.com/apps/new.
    • Choose Application Type: Client.
    • Choose Default Access type: Read and Write.
  • Once you have your application registered, copy down the following information. You will need these in your Android source code:
    • Consumer key
    • Consumer secret
    • Access Token (oauth_token)
    • Access Token Secret (oauth_token_secret)

Java Library: Twitter API ME Setup

You will use the Twitter4j library to access the Twitter API from your App.

  • Download ttwitter4j-4.0.0.zip and unzip.
  • Add the Twitter4j library files to your Android project in Eclipse:
    • Create a new Android Project in Eclipse.
    • Create a new folder called "jars" inside the project.
    • Copy the file twitter4j-4.0.0/lib/twitter4j-core.jar into your jars/ directory.
    • Inside eclipse, right-click the jars folder and select Refresh to make sure Eclipse recognizes the files you just added.
    • Add the jar files to your Android build configuration.
  • Many Twitter API calls require authentication. To keep things simple, we suggest you use Single Access Token authentication. Look at the example code snippets on the stackoverflow. You will need to enter the Consumer key, Consumer secret, Access Token (oauth_token), and Access Token Secret (oauth_token_secret) from above.

Application Permissions

  • Because your application will have to use the network, you must give your app permission to access it:
    • In Eclipse, open the file AndroidManifest.xml (right-click - Open With - Text Editor).
    • Add the following line before the last line </manifest> :
      <uses-permission android:name="android.permission.INTERNET"></uses-permission>
  • For more information, see Security and Permissions and <uses-permission>.

Updating the UI from another thread

Network transfers and web API calls are long-latency operations. To keep your application responsive, you don't want to run such operations in the main GUI thread. The Twitter API ME library, like many other libraries, will spawn new threads to handle network I/O and notify you asynchronously when new data has arrived. You cannot directly update the UI from such callbacks, because only the main GUI thread is allowed to update the user interface. You will need to learn about Handler objects to notify the GUI thread of changes.

Submission Instructions

Create a Wiki Page for this assignment

Begin by creating a new wiki page for this assignment. Go to your user page that you created when you made your account. You can get to it by typing the following URL into your browser:

http://mips.lrdc.pitt.edu/cs1635-spring14/User:FirstName_LastName

Replace FirstName and LastName with your real first and last names. This will take you to the page you created for yourself when you created your wiki account. If you have trouble accessing this page, please check that you created your wiki account properly.

Edit your user page to add a link to a new wiki page for this assignment. The wiki syntax should look like this:

[[IndividualAssignment4-FirstName_LastName|Individual Assignment 4]]

Again replace FirstName and LastName with your name. Then click on the link and enter the information about your assignment. You should upload one file (described below) and in the wiki page, describe any extra credit functionality you implemented and want us to review.

Upload Project

  • Your submitted project must include the full source code as well as the executable of the working application and the one page challenges and lessons learned.
  • Remove your private Twitter API keys from the source before submitting. - Replace them with empty strings.
  • Create a zip file of your project tree (the top-level folder that includes the Eclipse project. Rename the zip file to apk4-firstname-lastname.zip
  • Upload the zip file to the IndividualAssignment4-FirstNameLastName page you just created:
    • Create a new file link like this: [[File:apk4-firstname-lastname.zip]]
    • Save the page, then click on the File link you just created to upload the zip file.


Add Link to Your Finished Assignment

One you are finished editing the page, add a link to it at the bottom of the page with your full name as the link text. The wiki syntax will look like this: *[[IndividualAssignment4-FirstName_LastName|FirstName LastName]]. Hit the edit button for the last section to see how I created the link for my name.

Links to Finished Assignments