Let's start with a demo:
The assignment--or, the Desired User Experience:
Our assignment was to have the user be able to use the android Location API to detect the appropriate circumstance--within 50 meters from Sproul Plaza--for launching a random notification to the user's watch. This would notify the user to open up the specified card to get their assignment. This in turn would launch a Drawing Activity on their phone. Submitting would retrieve a random "cs160fsm"-tagged picture, send their masterpiece to Flickr with the same tag, and get a "reward" that is a new card on their watch with the aforementioned random image.
The hopefully ensuing User Experience:
I tried to stay as faithful as I could to the specific assignment.
The first thing a user sees is the Welcome screen. If the FSM Toq applet is not already installed, pressing that button will install it. Now I actually created the app in Fremont so I used my location, not Berkeley's but in the final version (the APK file below should reflect this), I used the provided Sproul coordinates as a location from which to compare the user's current location. If the distance is less than 50 meters, one of six notifications will appear on the user's watch at random. The notification alerts the user to create a drawing.
So the user navigates to the FSM applet on their watch and selects the appropriate card. This triggers the next screen--a drawing activity--to open on the user's phone. They may now create their assigned drawing. Features include black, blue, yellow, and red colors, thin, medium, and thick brushes, an eraser mode, an undo button, and finally a submit button. Upon submitting, their drawing is uploaded with the cs160fsm tag onto their photostream. The phone reverts to the initial Welcome screen. However, the Welcome/Install button is replaced with a Thank You button. Finally, a Thank You notification emerges on their watch. Now when they browse the cards and open the last card, they will see a reward image!
Pictorial depiction:
High-Level implementation details--or my solution:
- Two Activities: first one handles location and watch functionality and uploading to Flickr
- Second one handles drawing and downloading from Flickr
- Intents are used. However, a try/catch used in the initial case where getIntent() on onCreate returns null. Thus post-user-submission functionality is handled in this try statement.
Potential Extra Credit:
- An Undo button!
- Custom brush stroke width
- Probably won't count, but I researched a bit on these figures and on the notifications added either their birth/death years or in the case of Mr. Weinberg, a memorable (at least to me) quotation.
- For my spinners, I created my own adapter which used a custom row view that I added allowing me to display both text and an Icon. For consistency, I used this set up for both Color and Brush stroke switching.
Current Bugs/Nuances:
- When transitioning between colors, upon drawing with the new color, you see the old color until you lift your finger up.
- The prize notification lasts for a fraction of a second before a new notification that is another drawing assignment appears. The way I have it set up is that at certain time intervals, the Location API will fire a notification. So depending on external factors, this may not be a problem. The good thing is that once you enter the second activity, no more draw notifications will be fired to the watch
- The initial button is essentially useless if you already have the app installed. Clicking on it will just result in a Toast informing you that the applet is already installed.
APK file:
Notes: 1st time installers:
1) Go to build.gradle (the one nested inside App) and "Sync")
2) Change the Key/Secret
3) Change the location provider numbers based on external factors (you're phone/signals)
4) First time only: Click the Welcome/Install button
Sources:
- StackOverflow random method commented in code + some insight on setting my custom spinner with icons.
- I borrowed the three section demo apps but most heavily copied verbatim from Andrew's apps (Flickr Test + HelloToq).
- Google's documentation--for canvas, spinners, and Location API.



Comments