CS184 Homework Assignment 4
Multi-Touch on Fire(base)

Posted: Monday, Nov. 9
Due: Wednesday, Nov. 18 Friday, Nov. 20 (23:59:59)

Change Log:

Wed., Nov. 11, 10:00am: Extra Credit added
Fri., Nov. 13, 8am: Extra Credit requirement added on supporting Google account login
Mon., Nov. 16, 11:00am: Homework deadline extended to Friday, Nov. 20

Objective:

Implement touch and multi-touch drawing gestures on Android. Practice event handling and the use of a remote database: Firebase.

Instructions:

Start with the "basic activity" template in Android Studio.
Add Firebase support as demonstrated in the following Section Video.

a) Startup: A drawing space (SurfaceView canvas) above a FAB for Clearing the content in the lower right, and two more FABs on the left for undo and redo of strokes. b) Drawing with multiple fingers paints with different colors (from a pre-set color palette)
   
c) When changing device orientation to Landscape, the activity adapts the view as best as possible (but no scrolling required) d) New (multi-)touch events still paint onto the View
e) Back in Portrait mode, all strokes are still painted, but some may have moved off the screen.
 

 

All strokes (segments drawn between finger down and finger up events) should be stored in your Firebase, so when you leave the app and start it up again, the last drawing is still available, and undoing strokes should still work based on how you originally drew your sketch.

Please use the same naming conventions for package and app as in the previous homeworks, i.e., name your app <FirstInitialLastname>MultitouchFire.

Implementation Hints:

(Re-)Read "Canvas and Drawables". We suggest the use of a SurfaceView in the following way:

Extra Credit:

For an extra 4% of the points, implement support for multiple users contributing to a drawing in parallel. Start with Android App User Sign-In UI via Firebase, and log the user id with any stroke drawn. Then, make sure that whenever a stroke is added to the database, it is reflected in any of the clients (2 or more) that are currently connected to the Firebase. Also, undo, redo, and clear should only operate on a user's own strokes - other users' strokes should stay unaffected.

This may sound more difficult than it actually is, since that is the kind of thing that the Firebase Real-Time database excels at and was built for.

Additional small requirements for allowing simple testing by the TAs: Your login screen needs to support Google account login, as the TAs will test this functionality by logging in with multiple Google accounts. This is supported by the Firebase Android User Sign-In UI, so it should not be an extra effort. Just making sure that you support that option!

Hand in: