Extra features: brush sizes; ability to clean slate and start anew
OVERVIEW AND SOLUTION
The app first starts by getting the current location we are at, and compares that location with the location of Sproul. I use a built in method to determine whether our current location is within 50 meters of Sproul. If it is, then I start the Toq activity with an Intent and send a notification to the user's Toq watch -- I send the intent by checking, within the Toq onCreate method, whether or not this class was called by the Location class and if so, I, at the end of onCreate, will also call sendNotification. The notification is a random card out of six possibilities, one for each person that is listed in the project spec. Once the user sees the notification on their watch and opens the app on their Toq watch and scroll to the FSM app, they will see the six cards inside the app. They will click on the card that corresponds to the notification that they received. Once they click on the card, this will open up the drawing application immediately with an Intent. I look for this action using a listener in the deck of cards FSM app and performing the Intent when the card is open. The drawing app was created from a tutorial. The drawing app can use an eraser, can use 3 different brush sizes, and can use 12 different colors. You can also wipe the slate clean if you want to start over (which is new functionality not required by the specs). After, you can press the up arrow to save to Gallery and start submitting to Flickr. Once you click that button, the save happens automatically and the Flickr part will open up using an Intent. In the Flickr app, you can click Upload and once you do that you are taken to the Gallery and there you can click on the image that you just created from your gallery and once you select it, it is going to upload the image straight to the gallery to Flickr. I changed the tags to be "cs160fsm" and also changed the keys to my own that I got from Yahoo account. Once the image is uploaded, what I do is I get a randomized image from the "cs160fsm" Flickr tag page and I modify that image into a Bitmap with the dimensions of 255x288 and then I open up a new Intent to open up the Toq Activity with an Extra put into the Intent with this new Bitmap image that I got from Flickr. Within Within the Toq Activity within onCreate I check for whether an Intent is what called this to open and I look at the tag of the intent and since this Flickr class called this Toq Activity, I have logic inside this Intent looker-upper that will know that Flickr class called the Toq Activity class, and this automatically creates a new Card Image with the image to put onto the watch and it will add the card to the watch using the addSimpleTextCard method, and that is why when you go to the Toq FSM app after the Flickr upload, you will see a fancy new card with a fancy image drawn by a fellow student that uploaded to Flickr "cs160fsm".
Credit: Used code from an online drawing app tutorial and section coding activities to help with the app making!
My APK: If you can't find it, it is in FSM/app/app-release.apk
Comments