Assignment 2 — Mobile client/server application
Due date: 11:00pm AEST, Friday Week 10 ASSIGNMENT
Weighting: 30%
Length: Less than 50 MB 2
Objectives
This assessment item relates to the learning outcome 1, 2, 3 and 4. 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 internet application using an integrated suite of mobile software
development tools. More specifically on the client side jQuery Mobile, JavaScript and HTML5 and CSS are
used. On the server side we use JavaScript and the node server with various node packages. The Mongo
database is used as a data store and that data is also stored locally on the mobile device. Using JavaScript
store data in a mongdb database in a MLab cloud server using node express middleware.
Introduction
You are assigned the task of creating a data logger to capture truck 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 truck types employed. If
a truck type is selected, a page (fragment) is shown to record data values for that truck type. An entry
consists of driver data. When the Save Log Entry button is pressed this data is saved locally in the
application in a 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 truck type.
We will refer to our app as DriverLogs. The specification of this app extends that given in Assignment 1.
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. Please read the lecture/tutorials on the Moodle website.
This app is to be tested using the Safari, FireFox or Chrome browser and tested on an Android or iPhone
mobile device.
Client Side HTML / CSS / JavaScript Mobile Application
You are to implement this app using HTML5, CSS, JQuery Mobile and Cordova Phonegap.
The app is used by a truck company to record driver logs for five types of vehicle operated by the company.
A number of vehicles exist for each type and an ID number is used to identify these. For each individual
driver records are kept of trips times using a particular driver. For long distances regular stops need to be
made. The position and time of these stops are recorded by the app.
Images for the page/views required to implement the assignment were given in assignment 1 and are further
refined in the following figures. Please note that the illustrations are for reference only, and your actual pages
will be based on the CSS style-guide in use on your actual mobile device.
Home page view
The home page view is the same as in assignment 1.
Vehicle view
The pages for entering the vehicle data are all the same as in assignment 1 and so are not discussed further.
Page 2 of 6
Vehicle logs view
When the Show logs button in the vehicle types page header is pressed, the current date/time and
latitude/longitude should be added to the data structure used to store the vehicle data as in assignment 1. The
log entries are saved in the device's localStorage as before.
The updated vehicle logs page is shown in Fig. 1. Note the view now has a Get ... button on the left of the
header bar. Also note the button in the footer is now a Back button. Pressing this should take the user back to
the previous page (Vehicle view).
Fig. 1: Vehicle logs page.
Send button
When the Send... button is tapped all the vehicle logs for that type of vehicle are sent to the local server (and
saved in the file logs/logs.dat. The vehicle data is also saved to the cloud mongolab mongdb database
set up for this purpose. You should provide a success or failure alert. In the success alert, show the data that
has been sent. When a response is received another alert should indicate success or failure. When vehicles
logs have been sent the vehicles local logs should be cleared from localStorage so that the vehicle page will
now not show any logs.
If the Yes button is pressed the Send logs dialog shown in Fig. 2 is presented and we return the vehicle view.
If the No button is pressed we just return to the vehicle view.
Fig. 2: Logs sent confirmation.
Page 3 of 6
Get logs button
The Get logs button is used to search the mongolab mongdb database for all database entries that match the
vehicle variety (Car in the figure). The entries returned are shown on a new page as shown in Figure 3. The
entries are to be shown below the Cloud vehicle log entries: label as shown in the figure 3. Again
appropriate alerts need to be made when the request is sent and when a response is received. The Back
button takes the user to the previous page and Home takes the user to the home page.
Fig. 3: Cloud Logs entries page.
Server Side: node+packages and JavaScript server script
Our user data scheme has the following fields:
• vehicle – one of {Car, Truck 5T, Truck 10T, Tipper, Articulated}
• driver_id – drivers name from log
• rego –rego # from log
• start – startTime from log
• firstTime – firstTime from log
• secondTime – secondTime from log
• endTime – endTime from log
This data is to be stored in the mongolab mongdb database in a vehicle_logs collection. Entries are also to be
echoed (written) to a file in the ./logs directory of the local server in a file called logs.dat.
The server will have the following URL that provides requested services. The URL is based on
http://your.IP.address/vehicle/.
Your web service API will support these actions:
search/:query– searches for users in the mongoLabs database and returns all logs with that :query
value. :query will be one of the vehicle types {Car, Truck 5T, Truck 10T, Tipper or Articulated}
to search for. So valid URLs would look like http://your.IP.address/vehicle/search/Car or
http://your.IP.address/vehicle/search/Tipper.
Page 4 of 6
:vehicle/log – appends the vehicle entry to the local server file ./logs/logs.dat and to the mongoLabs
vehicle_log mongdb databases logs collection. So valid URL's using this scheme are
http://your.IP.address/vehicle/Tipper/log and http://your.IP.address/vehicle/Truck 10T/log.
Fig 4. Message flow from App to local disk storage and Cloud database
Fig. 4 shows the message streams in the application. Ideally the mobile device POST’s requests to the
WWW and receives responses from the WWW. The node server listens for requests on a port. The requests
data will be routed to the local mongdb database at mongoLabs. Requests for the information in the mongdb
database would be returned to the node server for POST’ing back to the mobile device. The server should
produce meaningful output each time a request is received or sent.
Your node server code will consist of a number of files; server.js will contain your business logic, common.js
and config.js contains common utility functions and network configuration information. The server.js file
will use express middleware to create a server and router to route the web service API to the handler code
that writes the JASON data to your mongdb mongoLabs database, and returns data from this database to the
mobile device. A sample of the kind of responses the server should produce is given in fig. 5
Fig. 5 Sample server screen feedback
See the weekly lecture/workshops for weeks 8, 9 and 10 for more information on this assignment.
MongoLab database Node server
WWW
Mobile - req/res
res
req
Local Storage
Client Server
Page 5 of 6
Required Documentation
You are also to prepare a Word document. Your word document should include an appropriate title page.
Your word document should have sections that address the commentary, hardware and software
requirements and the financial analysis given below
Plan for a Testing Strategy for your Mobile Web Site
Your document should:
• Discuss the selection of mobile browser models, mobile OS's and device manufacturers for your
testing process
• Discuss whether testing is required on actual devices and what part emulators/simulators can play in
this process
• Document functional and UI testing of the app.
Financial Case & Commentary of Application Features
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 Website
should be included. Explain what the features are and how they would help to improve the Website.
• Are there any ethical considerations in making this kind of service available?
• Discuss the economic/financial case for the proposed system.
Assume this simple exercise leads you to consider developing a fully-fledged VehicleLogs
application (that is generalised to handle any kind of log data) with increased functionality. Assume
you model 3 cases; one with 10 users, one with 1,000 users and one with 10,000 users.
- Assume staff development time is costed at $100/hour. Given how long it has taken you to
develop this exercise what do you estimate technical development costs to be in hours? What are
the development costs for the 3 models, assuming development time increase by 50% for each of
the scenarios?
- Database storage costs. If you use the mongdb mongoLabs service to store VehicleLogs entries,
how much would this cost for your proposed user base, assuming 10 entries per month per user?
- Discuss your marketing campaign for each of the three cases and estimate a cost for each of
these.
- When do you estimate you break even (costs=revenue) in the 3 scenarios? Comment on the
results of this analysis.
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 tar, rar or
zip together:
• The directory containing all the files, folders, images required to test your mobile application
• Your Word document
The resulting gzip, 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 gzip, rar or zip file when uploading to Moodle so that all
students work can be linked back to the author.
Page 6 of 6
Assessment criteria
Assignment
Component Criteria Marks Total
Cordova Phonegap
Integration ☐ The VehicleLogs app is successfully implemented in Cordova Phonegap 2
Client Side application
Send/Get buttons
☐ Javascript and HTML files correct
☐ Tap handler for Send sends data with feedback correctly
☐ Tap handler for Get gets data with feedback correctly
☐ Current logs page meets specification
☐ Cloud vehicle logs page meets specifications
☐ The data in the logs pages are formatted correctly
6
Server Side application
Config.js / config file
☐ The commonly used functions are all defined correctly
☐ Cross site scripting is handled correctly 2
VehicleLogs.js
☐ Appropriate response messages are sent, and appropriate messages are
written by the server as messages are routed (1 mark)
☐ The Vehicle_Logs collection at MongoLabs is successfully connected,
opened and updated (2 marks)
☐ The log() methods appends each entry received to ./logs/logs.data on
PC (1 mark)
☐ All entries for the given vehicle are returned in the response object
when the search/:query is performed (2
marks)
☐ The :vehicle/log request writes the data to the vehicle_logs user
collection of the mongdb database (2 marks)
8
Documentation
Discussion of testing
regime
☐ Discussion of selection of mobile models
☐ Discussion of part emulators vs. the real devices play in testing
☐ Document functional and UI testing of the app
3
Commentary
☐ Successful/unsuccessful features
☐ Additional functionality
☐ Ethical considerations
3
Financial case
☐ Time costing
☐ Database costing
☐ Marketing
☐ Analysis
☐ Synthesis
5
General
Feedback given as required
Use appropriate naming conventions
Adequate commenting
Correct grammar
Citation of references, copyright use
1
Penalties
Total 30
Lecturer Comments
Lecturer’s Signature Date: