teaching machines

Final Project: Task Man Special Edition

December 20, 2011 by . Filed under cs491 mobile, fall 2011, postmortems.

Initially for this final project I had planned on doing a twitter client complete with basic news feed, the ability to make a tweet, look at other users, etc…  Unfortunately I had many issues with using Twitter’s Rest API, especially when parsing out data I got back and getting users to authenticate.  Because of these problems I changed course and went back to one of the other applications I worked on to a) fix it, and b) add a few new features, and thus Task Man Special Edition was born.

 

The premise is simple, create a task management application that allows you to enter new tasks, update them, and track their status.  I use a SQLite database to store the tasks and they have four fields: id, name, details, and status.  Name is what is displayed on the task list, and details is displayed in the detailed view you get when selecting a task.  Status is displayed on both the list and the detailed view and can be “Not started, In progress, or complete.”  I made the decision to have Complete tasks and those in progress or not started live in separate views so as to not clutter in progress tasks with completed ones.

As can be seen, I opted to use in line menu navigation.  I think for future builds, I would like to move the add command and the two change view commands to a contextual menu brought up through the menu button.

 

The screen for displaying a task is simple enough, with the task title on top, its current status, the extra details, and then an edit button.

Clicking edit obviously takes one to an edit screen.  This edit screen is also used when making a new task (new tasks will default to “not started”).

The save button only performs the save and does not return to the previous view, for that you need to use the back button.  In future revisions is may be wise to add more “flow” buttons to the app.

I discovered that when using the radio buttons, they need to be placed inside a little view called “RadioGroup” to force them to only allow one active button at a time.  The xml for it looks like this.

<RadioGroup
android:id=”@+id/statusGroup”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content” >

<RadioButton
android:id=”@+id/choice0″
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:checked=”true”
android:text=”Not Started” />

<RadioButton
android:id=”@+id/choice1″
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:text=”In Progress” />

<RadioButton
android:id=”@+id/choice2″
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:text=”Completed” />
</RadioGroup>

From there, I used if statements to update the status of items based on the radio button that was clicked like so

if(choice0.isChecked()){
task.setStatus(0);
}
else if(choice1.isChecked()){
task.setStatus(1);
}
else if(choice2.isChecked()){
task.setStatus(2);
}

 

I didn’t see anything in RadioGroup that would return only the button currently active, but it was not and issue obviously.

 

Overall, given a relatively short turnaround time due to scrapping the other project, I’d say this one turned out ok, especially since it is bug free.  There are a number of features I would like to add in future revisions, including:

Time/Date tracking

Better flow controls

Contextual menu controls

Push to calendar task due dates

Associate tasks with contacts (ie, if you have a task that involves driving a friend to the airport, you could add a contact link to them in the task details)

Allow clean up of old tasks (aka. delete old tasks)

Add location settings to set the location of a task and bring it up on a map