You will design and implement a PDF reader that allows a user to read and annotate a document on an Android tablet. The screen should look something like this. Note that you have the freedom to change the layout and appearance, as long as you support all of the features and functionality described below.
When first launched, the application will load a sample PDF that you have included in your project. The titlebar should show the name of the PDF. The statusbar should show the current page number and the total number of pages (e.g. "page 2/5").
You need to support the following functionality. Unless a feature specifically states how you should activate it, you can choose how to present these to the user. e.g. buttons on toolbar, floating buttons for page up/down, or 'two-finger swipe left' to undo.
- Undo/Redo: Undo the last change that was made to the document. The user should be able to undo at least the last 5 actions that were performed. Redo can be used to revert the undo (as described in class).
- Drawing: The user can write on the screen with a thin line in blue ink, allowing them to write notes or annotate the document. The user cannot change the color or thickness of the line, so select line characteristics that are appropriate for writing on the PDF.
- Highlighting: The user can draw over the existing document with a thick, transparent yellow brush that allows the user to highlight the text in the PDF. Make sure that the highlighter is transparent enough that the text beneath it remains visible! See the diagram above for an example.
- Erase: The user should be able to erase an existing drawing or highlighting (note that 'undo' does not replace this feature).
- Zoom & Pan: The user can use two fingers to zoom-in and zoom-out (by bringing their fingers closer together or spreading them apart over the area of interest). When zoomed-in, users can pan around to reposition the document. These gestures should behave the same as standard pan-and-zoom (hint: try Google Maps on the emulator to see how these gestures should work). Users can draw and highlight a document at any scale, and the annotations should scale with the document canvas.
You should support multi-page PDFs, and your sample document needs to have at least 3 pages. The user should be able to move between pages - you need to decide how to add functionality to support this (up/down buttons, or perhaps a custom gesture).
Any gestures that you implement (e.g. zoom, pan, possible moving between pages) should respect direct manipulation principles. For instance, content should remain under your finger as you zoom or pan. Gestures should also follow principles discussed in class (e.g. given design principles, swipe-back would be a good choice for navigating to the previous page, but a poor choice for the erase tool).
You should optimize for a tablet in portrait mode (see below for device/AVD details). You should disable orientation changes in your application so that the layout remains in portrait mode as the device is rotated.
You should save changes when the user changes pages, or exits. A user should be able to make changes, exit your applicaton, and then reload it and see their changes intact. Drawing and highlighting should be saved on each page i.e. it should not be lost when the user navigates between pages.
- You are provided starter code that loads a sample PDF and logs touch events. You are free to use this code, or ignore it and implement everything your own way (but using this code will likely save you some time!)
- You must create this assignment as an Android project using IntelliJ 2020, with the Android SDK 10 or later. Instructions to install and configure IntelliJ are included in the Android development slides.
- For development and testing, use a Pixel C tablet, in vertical orientation.
- You can use any functionality included in the Android SDK, and are free to use code snippets from the Android sample code included with the SDK (i.e. a snippet being a small segment of code). You can also use any code that we have placed on the public CS 349 Git repo. If you do this, put comments in your code referencing the original source. You are not allowed to use any other third-party code or libraries, unless you obtain permission from the instructor (permission on Piazza is fine).
- You are not required to use Model-View-Controller, but you *must* save your data in such a way that no data is lost.
Your directory structure for your assignment submission should be in subdirectories under your a4/ directory in your Git repository. It should use a standard file layout for an Android IntelliJ project.
Your submission needs to include:
- All source code and resources required to build and execute your program.
- An IntelliJ project that compiles everything using the specified JDK and Android SDK, and which has a Run target that will execute your program.
- A `readme.md' file with any details required to help the TA grade your assignment.
- An APK file at the top-level of your directory structure. You will likely need to manually create this (Build -> Build APK) and copy to this location. This will help the TA to load and test your application without needing to load the project.
Your `readme.md' file needs to include, at a minimum:
- Your name,
- Your student number,
- Your operating system & version,
- The version of Java and the Android SDK that you used,
- The source for your image assets, as required.
Late assignments will not be accepted. Markers will test your application by running your APK file against the appropriate AVD. Your submission will be assessed roughly as follows:
- Code compiles and runs, readme, working project.
- PDF is displayed. User can scroll between pages.
- User can annotate the PDF using either the pen or highlighter.
- User can erase an annotation using the erase tool.
- User can undo/redo up to 5 levels of actions that they perform.
- User can zoom and pan using standing gestures. Annotations scale with the canvas.
- Data persists when application is restarted, or when the user nagivates between pages.
- User controls are obvious/clear and intuitive, and support the features required.
1.0. Aug 26, 2020. Initial draft.
1.0. Nov 14, 2020. Minor grammar and formatting changes. Removed draft label.