Lab 7 - Camera App
Before you Start
- If needed, review these videos.
- Check if your mark for Lab 3 and 5 has been recorded here (log in with your Passport York credentials). You should see something like the following screenshot. If you cannot find your mark, please show Lab 3 and 5 to the teaching assistant again.
ePortfolio Entries
Each entry consists of a web page and a zip file.
- Click on the assignment at the course website in Moodle. Submission is only open during the week of the lab and the week that follows.
- Zip the
src
folder of your Android project and store the zip file on the desktop (the video entitled AndProject shows you how). Name the file Xsrc.zip
(where X
is the name of the lab) and drag it to the lab submission site.
- Create your web page (inside Moodle) so it includes the following sections:
- Title and Authors:
This is a two-line header, the first identifies the lab (lab number and name) and the second identifies the team members. For each member, write the Passport York username and the full name.
- Introduction: This is a paragraph in which you describe what you did in this lab. The paragraph is limitted to at most three sentences so you need to abstract the essence of what you did rather than the detailed steps taken.
- Results: This starts with a paragraph that describes your findings: did your work achieve what was required, where there any unexpected results, did certain things not work, etc. This paragraph must be followed by screenshots and/or links to YouTube videos that showcase your findings in action.
- Discussion: In this section you should answer any question asked in the lab document. You can also add here any comment you may have (e.g. what you learned from the lab, what was particularly challenging, etc.).
- Your entry is saved as "draft" and remains as such (so you can optionally edit it) until you submit. Once you are happy with your draft, please ask the teaching assistant to mark your work. If the teaching assistant is happy with your code and web page, click the submit button. Also provide the Passport York username of both members of the group to the teaching assistant.
Programming Environment
- You will need a laptop with the EECS VBox (build-2016) installed
(additional information can be found here). This is the same as the one used in EECS 1012. You can use your own laptop or borrow a Departmental one.
- You will also need an Android tablet to deploy your app. A tablet will be given to each pair of students at the beginning of the lab session. You can also deploy your app on your own Android device but the teaching assistant will only mark it on the Departmental tablets.
- Make sure you are familiar with the VBox environment. In particular, you should be able to transfer files from it to the outside; i.e. to the host through a shared folder; to a cloud service (such as Google Drive or DropBox) through a browser; and to a USB drive.
- Make sure you are familiar with capturing screenshots and videos so you can embed them in your ePortfolio entry.
- If you are not 100% comfortable with any of the above then review the Lab Tools document of EECS1012.
The Lab
Model
The API of the Model class can be found here. The code of the Model class can be found here.
Controller
The API of the Controller class can be found here. The code of the Controller class can be found here.
View
Implement a view that has
- a button in the middle labelled Start,
- a button in the top left corner labelled Reflect-y,
- an ImageView below the latter button.
Initially, the view should look like the following.
Manifest
To AndroidManifest.xml
add
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
just before </manifest>
.
Required additions
- Add a button labelled Reflect-x to the view,
- add the method reflectX to the Model class,
- add the method reflectX to the Controller class,
- link the button labelled Reflect-x to the reflectX of the Controller class,
- add a button labelled Rotate to the view,
- add the method rotate to the Model class (rotation by 90 degrees, some details can be found here),
- add the method rotate to the Controller class, and
- link the button labelled Rotate to the rotate of the Controller class.
Optional additions
Add more functionality to your app. For example,
- allow the user to specify the number of degrees of rotation,
- scale the photo,
- allow the user to specify the scaling factor,
- etcetera.
Test
Before running your app, you need configure the device. Go to settings. Selects Apps. Find the Camera App. Select Permissions. Enable Camera and Storage.