Assignment Mobile Android Application

Assignment Mobile Android Application

Assignment — Mobile Android application

ASSESSMENT
1
Length: / Less than 50 MB

Objectives

This assessment item relates to the learning outcome 1, 2 and 3. More specifically, to design and implement a complex mobile application.

The objective of this assignment is for students to:

• Develop, test and maintain a mobile application using an integrated suite of mobile software

development tools. More specifically Android Java development is undertaken using Android Studio and Android API’s.

Introduction

You are assigned the task of creating a data logger to capture package location data in a mobile application that stores the data in a local database. The app has fields to record data for each of five cities were the app is employed. If a city is selected, a page (fragment) is shown to record data values for that city. An entry consists of city data. When the Save Log Entry button is pressed this data is saved locally in an application SQLDatabase. When the Show Log Entries button is pressed a related page (fragment) is shown that list all the date/time and data entries made for that city. We will refer to our app as CityLogs.

More details of these pages will be given in the sections below. You should also consult the weekly lecture/tutorials on the Moodle website for help and more information on completing the assignment. The tutorials contain step-by-step procedures for working through the assignment as well as some tips and extra help and clarification of the specification. Make sure you read the lecture/tutorials on the Moodle website.

The specification of this app will be further refined in Assignment 2.

Mobile Application Home Startup Page

i VlTj| Q 8:31

Packages:

PERTH

BRISBANE

SYDNEY

MELBOURNE

ADELAIDE

Fig. 1: Home page (fragment)
Page 1 of 6

The application start-up page (Home_fragment) is shown in Fig. 1. You are to implement this functionality using the Android API. The application should be based on a single activity with multiple fragments used to present various views (fragments). The city name buttons: Perth, Brisbane, Sydney, Melbourne and Adelaide, on the home fragment, link to the city page fragment/s discussed in the next section.

Perth, Brisbane, Sydney, Melbourne and Adelaide Data Entry Pages

These pages all have a similar appearance and so only the appearance for Perth page will be shown in the figures below. The page has large text for the cities’ name, Perth, at the top of the view area. In the figures below the lines of data that are to be logged and saved are shown.

The line immediately below the title line has the button "Time" with a text entry field beside it with a text field beside it to display the time in when the button is pressed. Below this the text "Contact ", followed by an EditText field to enter the contact phone number with the hint Phone number. This is followed by another text field with the label Invoice number and an EditText field to enter the invoice number with the hint invoice number. Then there is the label Destination with a spinner that is used to select one of the possible destinations {"", "Perth", "Brisbane", "Sydney", "Melbourne", "Adelaide"}. The layout and a sample input is shown in figure 2.

When the TIME button is pressed the TIME button should no longer be visible on the page, but the current time should appear in the text field adjacent to the button as shown in Figure 2 on the right. When the spinner is pressed a drop down list is shown and the selected item displayed.

The Save Log Entry is used is used to add the values to an internal data object that saves all values. The Show Log Entries button is used to present all the log entries in a list format as shown in the next section. If a field (time, contact, invoice number of destination) does not have a value then a Toast error message must be displayed indicating the problem, how to fix it, and the entry should not be saved. If the entry is saved an appropriate dialog should be given.

The Previous button will take you to the preceeding cities’s data entry page, the Next button will take you to the next cities data entry page. The Home button will take you to the Startup (Home) page.

Fig. 2: Vehicle variety data entry page (fragment).

Show Log Entry Page (Fragments)



This fragment contains a list view with each of the specific cities' time, contact number, invoice number and destination city, shown as a list item. Every saved entry for that city is displayed in the list like this. A city may have more than one entry during the week, so multiple entries can appear in the list, as shown in figure 3 on the right. At the bottom of the page is a button that returns the user to the city data entry page. Note this buttons' text is customised with the name PERTH.

Perth 19/3/2017 20:57 00 12345678 1122334455 Brisbane

Perth 19/3/2017 20:57 11 22668899 00000000 Sydney


Perth 19/3/2017 20:58 44 66774455 99999999 Melbourne

Options Menu pages


A number of menu options should be shown, if the user presses the console Menu button, as shown in Fig. 4.

If the user taps the Save entries Menu then all data in the lists of the 5 cities should be saved to a SQLite database on the mobile device. Typically this is done when the user finishes entering data for the day. When the application is opened this database is used to intialise previously saved cities' city logger entries to that given in the database. Subsequentially new values are added to the app as the user enters new data.

The Send all entries will be used for other purposes in the next assignment, but for now we will use it to clear the current database of all entries. This would typically be done at the end of the week. The Profile menu option is covered in the next section.

Profile page

The Profile fragment UI is shown in the Fig. 5. A Logger username edit text field is supplied to enter their username. Two text fields are also supplied so that the user can enter their associated password for this username. When the Save profile button is pressed this data is to be saved in local variables (for use in the next assignment) and the Home page (fragment) is shown. If the Cancel profile button is pressed the Home page is returned to. The intention of this is to allow for authentication to a company database at a later stage of development of this app.

i »mA B11:51

Packages:

Username:

Your name?

Password:

Password?

Repeat password:

Repeat password here

SAVE PROFILECANCEL PROFILE

Fig. 5: Profile page.

Other Features

When the Send all entries menu option is chosen the dialog shown on the left of the Fig. 6 is shown. If the "OK" button is selected then the existing SQLite database is cleared of all entries along with the local objects used to save the vehicles City logger entries. As a result subsequently showing the list for any vehicle will present an empty list.

When the Android BackButton is pressed on the Android device the dialog on the right of the figure below is presented. If the user taps the "Yes" button then the local City logger logs will be written to the SQLite database before quitting the application. If the "No" button is tapped then the application exits without saving any changes to the SQLite database. The intent is that when the user sends the data to home base the database is cleared.

Fig. 6: Profile dialogs.

Required Documentation

You are also to prepare a Word document. Your document should include an appropriate title page.

Your document should have two sections that address the hardware and software requirements and application commentary given below.

Hardware and Software Requirements

Your document should:

•Create a list of mobile devices and manufacturers targeted for the application. You should state what mobile devices where used to test the application and what version of Android is supported.

Application Commentary

Your document should:

•List the features you successfully implemented and those you were unable to successfully implement; you should describe the problem in a few sentences and also briefly describe anything you attempted to do to get it to work. Your approach to identifying and attempting to fix these bugs may gain you some partial credit for those features you were unable to implement.

•A description of any additional functionality you believe would be useful to add to this app should be included. Explain what the features are, and how they would help to improve the app.

Submission

You are required to submit your assignment electronically via the Moodle course website. The deliverable is a rar or zipped directory containing all the code and resources needed for testing. You must rar or zip (or tar) together:

•Locate your Android Studio project and zip or rar this folder.

•Your W ord document

The resulting rar or zip file should be submitted on the course website. Please note that you should use your student number as the name for your rar or zip file when uploading to Moodle.

Assessment criteria

Assignment
Component / Criteria / Marks / Total
MainActivity file / -The onBackPressed() method display the Save dialog
-Pressing "OK" in the onBackPressed() method saves the SQLite database and exits
-The ArrayList values are set from the SQLite database entries on entry (2 marks) / 4
Fragment files / -The home, next and previous buttons work as required (2 marks)
-The city time/date button work as required
-The spinner works as required
-The city log entries are saved by the Save Log Entry button
-Errors are caught and appropriate messages displayed
-The profile page checks that the passwords match, no items are null and returns to the home fragment
-Show Log Entries button works and shows all entries for that city type and returns to the correct page (3 marks) / 10
res/layout/xml and other files / -Items on fragments are in the correct positions w.r.t. each other
-EditText items have the correct hints
-Navigation buttons are in a line and of equal width
-Labels are all as given in the specifications
-The City class exists and is correct
-The spinner has the values stored in the strings.xml file / 6
Menu options / -The Profile menu is present and works as specified
-The Save entries menu saves the correct values to the database (2 marks)
-The Send entries menu option clears the SQLite database and all the city ArrayLists / 4
SQLite database / - The DBAdapter class is present and works correctly / 2
Hardware/Software & commentary
Hardware / Software requirements / 1
Application commentary / 2
General
-Feedback given as required
-Use appropriate naming conventions
-Adequate commenting
-Correct grammar
-Citation of references, copyright use / 1
Penalties
Total / 30

Lecturer Comments

____ Date:

Page 6 of 6