This is the great looking main screen that opens when the app first opens. The files that are used to operate this screen are the MainActivity.java file which can be found in the directory app > src > main > java > com.example > MainActivity.java along with the activity_main.xml layout file which can be found at app > src > main > res > layout > activity_main.xml. The app also returns to this screen after adding a person to the database or after the user is done with the photo gallery. If you click the Open camera button you are brought to the default camera screen shown below. |
The camera is called by using an Intent which means it calls the default camera app as shown on the right. After the camera takes the picture the user is asked to either save or discard. If they discard they are brought back to the camera screen, if they save they are brought to one of two screens shown below. There is no code for the camera because the code is already written in the phone. |
More often than not the user will be brought to this screen. This is the screen where the app guesses who is in the picture. In order for the computer to guess who is in a picture there needs to be data in the database, in other words there needs to be at least one picture in the photo gallery. If there is at least on picture in the database it will bring the user to this page after the new picture is saved. As you can see in the picture on the right, the user is asked if the app was correct at guessing the face. There is also a little thumbnail of the person who the app thinks the user is. In this situation the app is correct, so the user would click the "Yes" button. After the user clicks yes, the data is added to the database and is then sent to the Main screen, or MainActivity.java. However, if the app was wrong in guessing the face the user can click the "No" and are brought to the screen below to enter the name of the person in the picture. The function that is associated with this interface is found in the directory app > src > main > java > com.example > FaceGuess.java and the layout code can be found at app > src > main > res > layout > activity_face_guess.xml. |
If there is no data in the database when a picture is taken by the camera the user is immediately sent to this screen. This is the Match Name With Face screen. Another way a user can land on this interface is by clicking the "No" button on the Face Guess page (see above). In this screen the user is asked to type in a name associated with the face in the picture. If the name entered by the user already exists in the database, the user will be prompted if they would like to add to the existing file associated with that name, or if they would like to create a new instance of the person using the same name as shown on the right. The code for this page can be found in app > src > main > java > com.example > matchNameWithFace.java. The layout can be found at app > src > main > res > layout > activity_match_name_with_face.xml. Once the user selects either option on the right or clicks the "Enter" button, the data is then saved to the database and the user is brought back to the Main screen (see above). |
This is the photo gallery. It can be accessed only from the Main screen and can only return back to the Main screen using the back arrow in the top left corner of the screen. Here we can see all the data in the database. It displays the thumbnail of the person, the name of the person as entered by the user, and the eye distance of the person in the picture. To the right of this information is a small clickable box that puts a checkmark in it. This allows the user to click on the "Delete Selection" button at the top of the screen. When clicked, all selected data entries are deleted from the database. Be careful however because this action is not undoable. This code can be found in app > src > main > java > com.example > PhotoGallery.java. The photo gallery also uses two xml files, app > src > main > res > layout > activity_photo_gallery.xml as the layout for the interface as well as the app > src > main > res > layout > row_layout.xml as the layout for each row in the list. |