Overview
picket watch noun [ˈpi-kət wȯch] : a wordplay of "pocket watch"
Picket Watch is a Toq smart watch app that supports collaborative, location based, poster creation activity—inspired by the 50th anniversary of the Free Speech Movement (FSM).
A user walks across Sproul Plaza wearing the Toq Watch and carrying their Android phone. Their watch vibrates and presents a notification stating to draw the text corresponding to a random historical figure involved in the 1963 Free Speech Movement. These historical figures are: Mario Savio, Jack Weinberg, Joan Baez, Michael Rossman, Art and Jackie Goldberg.
How Picket Watch Works
1. When a user launches the app on their phone, a custom splash screen contained within ToqActivity
will appear. Under the hood, onCreate()
gets called and instantiates components needed from the Toq API (e.g. DeckOfCardsManager
, DeckOfCards
event listener). Two more methods within onCreate()
get called: init()
and install()
. init()
creates a card image for the six pictures of the six figures and stores the card images in an array. It then adds these card images to the resource store. install()
installs the deck of cards from the resource store.
2. A location manager and location listener object are also instantiated within onCreate()
so that the app can check when a user’s GPS coordinates have changed and send a notification to the Toq watch when the user is within 50m of Sproul (calculated by subtracting the distance between the latitude/longitude of the user and that of Sproul, then checking if that distance is less than or equal to 50m).
3. The notification triggered will be a card whose title is randomly selected from an array of possible titles relating to the historical figures (e.g. "Mario Savio says: "
or "Jack Weinberg says: "
). The message of this card will instruct the user to draw an object. The user navigates to the watch applet and selects the appropriate card corresponding to the notification, calling onCardOpen()
from the DeckOfCardsEventListenerImpl
class. This method creates an intent to launch the MainActivity
class, so the drawing canvas will now appear on the phone screen. The drawing component of the app uses Path
, Paint
, and Canvas
objects.
4. On the drawing canvas, the user can select the 'New' icon for a new canvas, different brush colors/sizes, an eraser tool, the 'Save' icon to save the drawing to the phone's internal storage, and the 'Upload' icon to select the drawing from the image gallery and upload to Flickr with the #cs160fsm tag. When the 'Upload' icon gets clicked, MainActivity
(where the drawing canvas resides) creates an intent to launch ToqActivity
(where all the Toq and Flickr logic resides) and launches that intent after putting an extra key-value pair "userClickedUpload" : true
. The onResume()
method in ToqActivity
will check for the 'userClickedUpload' key in the intent and populate the image gallery on the phone through another intent.
5. When the user selects a drawing from their image gallery, a POST
request gets issued via flickrj to upload the image to the user's Flickr account with the #cs160fsm tag. A random Flickr image with the #cs160fsm tag will then be pulled via a GET
request, rescaled to 250 x 288 px, and set to be the image of a card that will be added to the deck of cards and resource store. The user can then scroll down the bottom of their list of six cards on the watch applet and click the seventh 'Wildcard' to view the pulled picture. Subsequent presses of the 'Upload' button on the smartphone app will continue to replace the pre-existing 'Wildcard' with a new one set to yet another randomly pulled image by generating a unique, random string for the card ID each time.
Images
Video Demo
Code
BitBucket link: https://bitbucket.org/jemoonette/picketwatch/
Couldn't generate APK...
Extra Features
- Ability to change brush size and eraser size for drawing
- Custom intro screen
- Custom app icons
Comments