0% found this document useful (0 votes)
51 views6 pages

Technical Assignment 2 - S2021 1

The document provides instructions for Technical Assignment 2, which involves designing and implementing an Android mobile application to manage user profiles using SQLite database. Students must create an app with two activities (main and profile) and a dialog fragment. The main activity displays a list of profiles from the database and allows adding new profiles. Selecting a profile opens the profile activity and displays its details and access history. The app must use an MVC structure with two database tables to store profiles and access logs. Students will be graded based on meeting requirements, proper MVC design, and code quality. The assignment is due by October 16th.

Uploaded by

ivan.chernikov25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views6 pages

Technical Assignment 2 - S2021 1

The document provides instructions for Technical Assignment 2, which involves designing and implementing an Android mobile application to manage user profiles using SQLite database. Students must create an app with two activities (main and profile) and a dialog fragment. The main activity displays a list of profiles from the database and allows adding new profiles. Selecting a profile opens the profile activity and displays its details and access history. The app must use an MVC structure with two database tables to store profiles and access logs. Students will be graded based on meeting requirements, proper MVC design, and code quality. The assignment is due by October 16th.

Uploaded by

ivan.chernikov25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Concordia University

COEN/ELEC 390
Fall 2021
Technical Assignment 2
Deadline: Saturday, October 16, 2021 @ 11:55 pm
Early submission: +2% bonus per day before submission deadline
Late Submission: -20% for every 1 day late after due date

Objective
Design and implement an android mobile application with description given below. Using SQLite to save
data and read data in an MVC structure with the use of DialogFragment. By the end of the assignment,
you will end up with a simple application to manage a database of simple profiles for users, with a profile
consultation history feature.

Application Description
Two Activities: mainActivity, and profileActivity. The mainActivity has an action button which opens a
DialogFragment allowing the operator to add user profiles to the database. The mainActivity displays the
list of all user profiles, showing only the profile name. Each list item is clickable, clicking on a list item
opens the profileActivity and display the details of the user profile entry clicked. Because the data in the
profiles may be sensitive, the profileActivity also displays a list of all previous time & date where the profile
was opened.

Approximate Mockup of app Navigation


Requirements
General
• Two Activities: mainActivity and profileActivity.
• profileActivity is a child Activity to mainActivity (up navigation is provided).
• A DialogFragment to add profiles to the database
• Opened from the mainActivity using the Floating Action Button

MainActivity
• mainActivity has a textview at the top which displays:
• the total number of profiles stored in the database.
• how the database entries are displayed in the listview (by ID (increasing order) or by Name
(alphabetical by Surname))
• mainActivity has a Floating button that opens an “Insert Profile” DialogFragment.
• mainActivity has a ListView that displays all the profiles stored in the database.
• Each line corresponds to one profile
• Each line shows either the profile name or the profile ID
• Each line starts with the line number of the entry in the listview
• Every item in the list is clickable. When an item is clicked, go to profileActivity.
• The mainActivity will have a toolbar with an action to toggle between two modes:
• Profile name Display mode:
▪ Default display mode
▪ Each listview entry is a line number and the profile “Surname, name”.
▪ The listview entries will be ordered alphabetically using the Surname first.
▪ display mode can be toggled to “By ID” using an action in the action bar.
• Profile ID Display mode:
▪ display mode can be toggled using an action in the action bar.
▪ Each listview entry is a line number and the profile ID number.
▪ The listview entries will be ordered in increasing order using the ID number.
▪ display mode can be toggled to “By Name” using an action in the action bar.

InsertProfile DialogFragment
• Insert Profile Dialog Fragment has:
• 2 EditTexts for profile Name and Surname
▪ 2 strings, no special characters except “–‘ ” (dash ,apostrophe, space)
• 1 EditText for profile ID#
▪ 8-digit integer, 10000000 to 99999999, no duplicate ID# allowed!
• 1 EditText for profile GPA
▪ 1 float number, 0 to 4.3
• 2 buttons for save profile and cancel.
• Save button:
▪ saves the input of the edit texts as a new profile in the database
▪ returns to main activity and reloads the listview.
▪ Does not save if some fields are empty or information entered is invalid.
▪ A toast notifies the user about missing/invalid entries.
• Cancel button: closes the dialog and returns to main activity.
• See Dialog Fragment example from Tutorial 4 for an example
ProfileActivity
• profileActivity has:
• TextView(s) that display all the information of the profile: (Must show the profile
corresponding to the entry clicked from the listview in the previous activity).
▪ Name
▪ Surname
▪ ID#
▪ GPA
• Textview header to the Access History listview.
• ListView displaying the timestamps, formatted as yyyy-mm-dd @ hh:mm:ss, indicating
when the profile was created, opened, closed & deleted.
• Delete action menu item which deletes the profile that is currently opened in the
profileActivity then go back to the mainActivity and reloads the listview of the profile.
• A toolbar with an Up navigation to the mainActivity
• When the profile is created, a “created” entry is added to the access table.
• Each time a profile is opened from the mainActivity, a new access “open” entry is added to the
access table.
• Each time a profile is closed, a new access “close” entry is added to the access table.
• Deleting a profile does not delete the access entries in the database, it adds a “profile deleted”
entry with a timestamp.

DatabaseHelper
• DatabaseHelper provides:
• Creation of an SQLite database with two tables
• Helper functions to
▪ Add entries in both tables
▪ Read entries in both tables
▪ Delete entries in only the Profile table
• All add/read functions should return Access or Profile objects
• You must create the Access and Profile Classes to use their objects with the helper.
• Use Setters/Getters and an appropriate constructor function
• See Course.java class file from Tutorial 3-4 for an example
Things to help you with the assignment.
Your database will have the following tables:

Profile table:

• ProfileID primary key


• Name
• Surname
• Profile GPA
• Profile creation date

Access table:

• AccessID primary key


• Profile ID number
• Access type (created, opened, closed, deleted)
• Timestamp (time & date)

To select all the Access entries for one profile, you need to select Access entries where Profile ID in table
“Access” is equal to the Profile ID from “Profile” table.

When creating Access entries for a profile in the Access table, you need to insert them with a Profile ID
corresponding to the profile in the Profile Table, as follows.
Profile Table Access Table

Profile ID Surname Name […] AccessID Profile Access Timestamp


ID# Type

10000001 Asimov Isaac […] 1 10000001 created 2021-06-06


@ 16:13:15

20000002 Burgess Anthony […] 2 20000002 opened 2021-06-09


@ 04:25:32

[…] […] […] […] 3 10000001 opened 2021-06-09


@ 04:29:37

In the above example, the first and third row in the Access table belong to the first entry in the Profile
table. The second row in the Access table belong to the second entry in the profile table, because of the
corresponding Profile ID.

An example of a similar project with multiple tables and the android implementation can be found:
http://www.androidhive.info/2013/09/android-sqlite-database-with-multiple-tables/
If you have problems with SQLite, I recommend implementing the example project above and understand
it well.
Assignment submission and procedure
Original work

This is an individual assignment. Your submission must be your own work.

You may use tutorial and online sources to understand, but you must write your
own code. Do not directly use code (copy/paste) from internet sites, or from any
other individual. As a rule of thumb, avoid having both IDE and code references
open side by side. Look at the reference, identify the important elements and
switch to the IDE to work on your code.
You must submit your assignment before midnight on the due date using moodle Assignment Submission
in the submission link tagged with the tutorial section you are registered in (very important, a wrong
submission might be considered a late submission). The file submitted must be a .zip (no .rar) file named
StudentID_Ass2 containing the entire android project folder.

Before submitting your code make sure you clean the project OR use the following project export
procedure (the export procedure seems better than cleaning the project).

Evaluation criteria and grading scheme

Meeting the requirements and use cases 80%


Using MVC design 15%
Clean code: well commented, proper naming, easy to read and understand. 5%
Possible bonus for quality UI design.

If the project submitted does not compile and run the student will receive a grade of 0! So, make sure
even if the assignment is not completely done that you submit an application that can be built and run.
We will not grade none compiling code.
Before submitting your code make sure you clean/export the project.
Points may be deducted for uncleaned projects.

Use this: Android Studio --> Build --> Clean Project

Use this to export a project: Android Studio --> File --> Export -> Export to Zip File

You might also like