sample dissertation format - computing science and ... web viewdissertation submitted in partial ......

60
Mobile application on Android platform for van drivers to maintain customer records S. Mustafa September 2011 Dissertation submitted in partial fulfilment for the degree of Master of Science in Advanced Computing Computing Science and Mathematics University of Stirling

Upload: vanquynh

Post on 05-Feb-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

Mobile application on Android platform for van drivers

to maintain customer records

S. Mustafa

September 2011

Dissertation submitted in partial fulfilment for the degree of

Master of Science in Advanced Computing

Computing Science and Mathematics

University of Stirling

Page 2: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

Abstract

Today Mobile devices are very popular and become a part of everyday life. As market of

Mobile devices grows the range of Application developed grows as well. Businesses largely

use facilities given by Mobile platforms to optimize their work.

The biggest advantage of mobile application is that it can be used anywhere. Even if there is

no network available, user still can save data temporarily on the phone.

This project was designed for local company called mylocalfarm.co.uk based on Bridge of

Allan, which sells produce across Central Scotland. Company is running a website, where

company sells they sell fruits, vegetables, bakeries and other types of produce. On the web

site registered users select items to add to delivery box. Then customer receives selected

items weekly. While making deliveries drivers maintain manually list of orders for current

day.

Because of increasing amount of customers company would like to optimize delivery pro-

cess. Since drivers are provided with phones on Android platform, company wants a mobile

application which allows maintaining the list of order while out of office.

Also the application should allow user edit specific fields such as amount paid or notes in

existing list. Because customer data is store on the web server, the application needs to be

able to communicate with the server in order to get the data.

2

Page 3: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

Attestation

I understand the nature of plagiarism, and I am aware of the University’s policy on this.

I certify that this dissertation reports original work by me during my University.

Signature Date

3

Page 4: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

Acknowledgements

I would like to thank Dr Mario Kolberg for his support and great ideas throughout the pro-

ject.

Also I would like to thank MyLocalFarm.co.uk for giving me access to their test servers and

being patient while developing application.

4

Page 5: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

Table of contentAbstract..................................................................................................................................2

Attestation..............................................................................................................................3

Acknowledgements................................................................................................................4

List of Figures........................................................................................................................7

1 Introduction.........................................................................................................................8

1.1 Background and context..............................................................................................8

1.2 Overview and Objectives...........................................................................................10

1.3 Achievements.............................................................................................................10

1.4 Overview of dissertation............................................................................................11

2 State of the art...................................................................................................................12

2.1 Existing applications..................................................................................................12

2.1.1 Courier Complete................................................................................................12

2.1.2 Packetracer for Android......................................................................................13

2.2 Android OS................................................................................................................13

2.3 Android Emulator......................................................................................................15

2.4 SQLite database.........................................................................................................15

2.4.1 SQLite advantages..............................................................................................15

2.5 PHP............................................................................................................................15

2.5.1 PHP advantages..................................................................................................15

2.6 MySQL......................................................................................................................16

3 Requirement analyses.......................................................................................................17

3.1 Online system............................................................................................................17

3.2 Delivery process........................................................................................................17

3.3 Requirement specifications........................................................................................17

4 Planning and design..........................................................................................................19

4.1 Overview....................................................................................................................19

4.2 User interface.............................................................................................................20

4.3 Integration with database...........................................................................................22

4.4 Security......................................................................................................................23

4.5 Communication with the web-server.........................................................................23

5 Implementation.................................................................................................................25

5.1 Welcome screen.........................................................................................................25

5.2 Main screen................................................................................................................25

5.3 List of orders..............................................................................................................26

5

Page 6: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

6 Testing...............................................................................................................................32

7 Conclusion........................................................................................................................33

7.1 Evaluation..................................................................................................................33

7.2 Future work................................................................................................................34

References............................................................................................................................35

6

Page 7: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

List of Figures

Figure 1. Worldwide smart phone market shares Q4 2010......................................................................9

Figure 2. Store Sizes, Total number of applications................................................................................9

Table 1. Global Mobile Application Store Ranking in 2010 and 2009..................................................10

Figure 3. Complete Courier Mobile device application........................................................................12

Figure 4. Packetracer for Android..........................................................................................................13

Figure 5. Android OS architechture.......................................................................................................14

Table 2. Description of the delivery list.................................................................................................17

Figure 6. Interaction between system parts...........................................................................................19

Figure 7. Schema of the main screen.....................................................................................................20

Figure 8. List of orders..........................................................................................................................21

Figure 9. Order details...........................................................................................................................21

Figure 10. Password request..................................................................................................................22

Figure 11. Change password..................................................................................................................22

Table 3. Fields of Order table................................................................................................................23

Figure 12. Downloading process...........................................................................................................24

Figure 13. Uploading process................................................................................................................24

Figure 14. Welcome screen....................................................................................................................25

Figure 15. Main screen..........................................................................................................................26

Figure 16. Loading data from the server................................................................................................26

Figure 17 List of orders.........................................................................................................................27

Figure 18 Order details..........................................................................................................................28

Figure 19. Drop down list......................................................................................................................28

Figure 20. Edit field value.....................................................................................................................28

Figure 21. Upload data back to the server.............................................................................................29

Figure 22. Changing the password........................................................................................................30

Figure 23. Error in connection...............................................................................................................30

Figure 24. Wrong password...................................................................................................................31

Figure 25. Empty field...........................................................................................................................31

7

Page 8: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

Introduction

This project designed and implemented an application for maintaining delivery lists for My-

LocalFarm.co.uk using Google’s Android platform.

1.1 Background and context

The project is designed for local company named MylocalFarm.co.uk which is based in

Bridge of Allan. Company sells produce like fruits and vegetables, bakeries and so on. Com-

pany sells it across Central Scotland. The selling process goes online via company’s website.

Registered customers may select items from the website and pay for order online. Once the

order has been placed company drivers deliver chosen goods for clients.

The company’s website runs on Windows server. The customer information is stored on

MySQL database. Admin pages of the website are written in PHP and content is managed by

Joomla framework.

Company would like to optimize delivery process. Instead of using printed handouts man-

agers decided to start using handsets for this purpose. It was decided to use Android phone as

a mobile device which stores the necessary information.

Mobile devices are getting popular year after year. Nowadays people use mobile devices in

their everyday life. Growth of popularity is noticed in smart phones market. According to

Canalys’s report which is described on figure below the global growth of smart phones mar-

ket at Q4 2010 compared to Q4 2009 is 89% [1]. This significant rise is explained by con-

venience of smart phone usage. Smart phone is a “mobile phone which includes functions

similar to those found on personal computers” [2].

On the other hand a big variety of smart phone vendors existing in the market offers their

own mobile platforms. According to the same report by Canalys, the largest part of the mar-

ket is taken by devices based on Google’s platform, overtaking its biggest competitor

Apple’s iOS phones. The graph is shown on Figure 1.

8

Page 9: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

33%

31%

16%

14%

3% 3%

Google Nokia Apple RIM Microsoft Others

Figure 1. Worldwide smart phone market shares Q4 2010

The Android platform has several benefits for developer over its competitor platforms.

Firstly, it is open platform and mostly no fees required from the developer. Also Android has

an access to Google Map to display locations and peer-to-peer messaging without using

SMS. As a result there is a big range of Android apps, which attracts more and more con-

sumers.

However, the most important factor for smart phone is a range of applications available for

it. Today the Apple’s app store is holding the lead in the app market share. Figure 2 shows

that Apple had the biggest app store in US by February 2010 [3]. Probably it is because

Apple was the only app store at the beginning.

9

Page 10: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

Apple

BlabkBerry

Android

Nokia (OVI)

Palm

Windows

0 20,000 40,000 60,000 80,000 100,000 120,000 140,000 160,000

150998

4,756

19897

6118

1452

693

Figure 2. Store Sizes, Total number of applications

Nevertheless, according to application store ranking in 2010 and 2009 share of Android in-

creased rapidly. Table 1 shows that the share rise almost 3 times [4].

Table 1. Global Mobile Application Store Ranking in 2010 and 2009

So now it is obvious that MyLocalFarm.co.uk has chosen Android phone to be used as solu-

tion.

10

201

0

Rank

Store

2009

Shar

e

201

0

Sha

re

Year-

Over-Year

Growth

1 Apple App Store 92.8

%

82.

7%

131.9%

2 BlackBerry App

World

4.3% 7.7

%

360.3%

3 Nokia Ovi Store 1.5% 4.7

%

719.4%

4 Google Android

Market

1.3% 4.9

%

861.5%

Page 11: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

1.2 Overview and Objectives

The aim of this project is to develop an application which would be used by MyLocal-

Farm.co.uk drivers. Customer base is increasing so the number of orders rises as well. Cur-

rently there are 1300 registered customers on the website. 200 of them are getting orders

every week. So there are dozens of orders every day. Managing this manually on printed out

lists makes drivers’ life complicated and affects the delivery speed. So company decided to

optimize the process of delivery. Company wants all lists of order stored on a handset. So

that driver does not need to print out, memorize or mark anything.

The objective is to create an application which stores information about daily orders in it.

The application needs to be able to look in details of orders and to give the user opportunity

to make changes in data. The delivery information is kept on the web-server, so it should be

transferred into phone’s memory. Once the deliveries are complete the database on the web-

server should be updated with data from the phone.

The application should not include too much security because the data is not accessed dir -

ectly from the web server but copied into phones memory. This might be helpful for applica-

tion speed.

Because at this moment there is only one driver in the company who is going to use no file

synchronization should be considered.

1.3 Achievements

Since all information is kept on the web-server, there are two main ways of moving data

into phone: first is wired and the second is wireless.

By first scenario data is retrieved from the web-server and saved on the local computer.

Then the phone is connected to the computer by cable and the data is downloaded into the

phone’s memory storage. After this the application accesses the downloaded information.

According to the second scenario no cable is used. The user just presses appropriate but-

ton and the phone communicates with the web-server via internet. Once connection is estab-

lished the application downloads data directly from the web-server into its own memory

space and accesses the information.

Finally it was decided to go for second scenario, in order to avoid problems in case if the

number of drivers rapidly increases. Because it can cause queues while downloading and

bring to delays in delivery.

To perform this phone sends HTTP POST request to run a PHP script on the server. This

script retrieves data from MySQL. In order not to overload phone’s memory the data not

saved as a file but as a database table. The Android phones run with an internal database en-

11

Page 12: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

gine called SQLite. So the application creates a database and saves downloaded data into a

table. This makes data accessibility easier.

Once deliveries are completed the application communicates with the server. Here it

sends HTTP POST as well. So all the data from SQLite database is uploaded back to the

web-server.

The data accessing process should be secure because the application accesses customer

data on the real web-server. As a result to upload or download data from the web-server user

needs to be authorized. And in the case if the user forgets password there is an opportunity to

change the password. There is a backup password as well for very bad cases.

As it was mentioned before there are many orders to be managed. To make the work with

list of orders easier there an opportunity to mark some orders as completed. So there is no

need to double check orders every time.

1.4 Overview of dissertation

The sections of the dissertation describe the process of developing this project.

They give an overview of each stage of the project.

The next section discusses existing similar applications in the market. Also the

brief overview of Android operating system is given.

The requirements analysis investigates the client needs. The current system over-

view is given and what the client is willing to automate is discussed.

The system design and planning draw initial developer’s view of the solution.

Here the solution is given as schematics.

The implementation shows the actual screens and discusses the background pro-

cesses. Finally the evaluation of the project and how the project might be extended is

written.

12

Page 13: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

2 State of the art

This chapter will discuss existing applications for couriers or delivery services. Also a

brief overview of Android platform and other technologies which are used at this project will

be given.

2.1 Existing applications

This project aimed to create a bespoke application for MyLocalFarm.co.uk to match their

requirements. There are no commercial application that has the same range of features and

functionality. There are some solutions which complete similar tasks.

2.1.1 Courier Complete

Courier complete is a Windows-based courier operation solution specifically designed for

the courier, messenger, and distribution industries. The system consists of two parts front

office and Mobile device application. It automates the front office, includes delivery track-

ing, online customer order entry.

Figure 3. Complete Courier Mobile device application

Dispatchers at the front office can choose information about item they want on the Dis-

patch board. This allows dispatchers to know where drivers are and what packages they

have. GPS tracking allows calculating average speed, time spent at customer location.

The Mobile device app allows entering the name of the recipient along with taking a sig-

nature. As it is shown on Figure 3 Mobile app has barcode scanning facility. [5]

Unfortunately, the mobile application is dedicated for Motorola ES400. Especially, the

barcode scanning implementation is based on integrated 1D UPC and 2D GS1 capability of

ES400. Also the system it tested and designed to work on United States’ network provider

AT&T, which makes it not suitable for the client.

13

Page 14: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

There are a few similar multi-platform solutions. Unfortunately, these sorts of systems are

suitable for companies which does delivery as a main service, because it includes a front of-

fice system as well. And that’s why too expensive.

2.1.2 Packetracer for Android

Packetracer is an application introduced by mobabel.net which allows tracking parcels.

User selects area or country where the parcel belongs to. Then the app provides a list of de -

livery companies. The user selects Delivery Company which deals with the parcel as it is

shown on Figure 4. This allows user to know what happens while delivery and what is ex-

pected delivery date. Also user can use barcode scanner or text scanner to scan barcode or

tracking number [6].

Figure 4. Packetracer for Android

This is basic but very useful tracking application for those users who are expecting for an

item to be delivered. Since MyLocalFarm.co.uk does not use services of delivery companies

but has their own driver, this application does not match the requirements.

2.2 Android OS

Android is an open-source operating system for mobile devices. The following diagram

show main components of Android architecture.

14

Page 15: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

Figure 5. Android OS architechture

Application layer contains a set of core applications such as email client, SMS program,

calendar, map and so on.

Android offers ability to develop wide range of applications. Developer gets access to the

same framework APIs as core applications. There is a set of services and systems which is

used by applications:

Views Content Providers Resource Manager Notification Manager Activity Manager

When the Android application runs it runs in its own Linux process, and its own instance

of Dalvik virtual machine. Dalvik is an optimized virtual machine which was designed to run

on low memory devices. VM runs Java complied files and uses “dx” tool to transform them

into .dex format.

After the application is installed it lives in its own security sandbox. Android is a multi-

user Linux system, so that every application has its own account and user ID. This avoids

applications to access other application’s memory space. However, it is possible for applica-

tions to share memory space. In order to implement it they should share the same Linux user

ID.

15

Page 16: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

2.3 Android Emulator

Android SDK includes an Android Emulator. It is a virtual device which allows developer

to run and test application without using a real phone. The emulator includes all hardware

and software features except making real calls. [7]

2.4 SQLite database

“SQLite is a software library that implements a self-contained, serverless, zero-configura-

tion, transactional SQL database engine.” It is the most widely deployed SQL database en-

gine. The source code for it is open [8].

2.4.1 SQLite advantages

SQLite does not need to be installed. It does not have any setup procedure. Also there is

no server process that has to be started or stopped.

Most SQL implemented as a separate server process. Programs that want access to the

database connected to the server using any interprocess communication to send requests to a

server and receive back results. SQLite does not work that way. With SQLite, the process

that wants to access the database reads and writes directly from the database files on disk. No

need for a intermediate server process. Main advantage of being servless is that there is no

separate server installation process, installation, configuration, provisioning, management

and troubleshooting. That is why SQLite is a "zero configuration" database. Programs that

use SQLite does not require administrative support to configure the database engine to run

them. Any program that has access to the disk can use the database SQLite.

On the other hand, a database that uses the server can provide better protection against

errors in the client application - stray pointers client can not damage the memory on the

server. And because the server is an ongoing process, it can control access to the database

with a higher precision that allows for more accurate and better concurrency.

2.5 PHP

PHP is widely used scripting language. It is very popular in web development. It runs at

the server side. Although it is usually used to develop web site it can be used with any other

applications to run a special script on a remote host.

2.5.1 PHP advantages

There many reasons of PHP being so popular. Let’s discuss some of them.

16

Page 17: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

PHP is available for free with documentation in many languages. It is very fast to develop

using PHP because scripts may be created with a little firm understanding of programming

principles. It is loosely typed.

PHP runs on most of operating systems. Also developers of Java, PERL and other lan-

guages can find it quite easy to develop on PHP.

2.6 MySQL

MySQL is an open-source server-side database which provides multi user access to sev-

eral databases. It is widely used with PHP. [10]

17

Page 18: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

3 Requirement analyses

In order to have clear goals for project requirements need to be specified.

Currently system at mylocalfarm.co.uk can be defined as main two parts. The purchase is

performed by online system and the final product is delivered by driver. Driver manually

maintains a list of orders while out of office.

3.1 Online system

Consumers use corporate website to place orders. User is able to pay online or by cash at

delivery.

The website runs on a Windows server with admin pages written in PHP. All data main-

tained by MySQL database. All information about consumers and orders is stored on the web

database. However this project does not cover developing an online system.

3.2 Delivery process

While making delivery driver fills a list of orders with details. The table below describes

the list.

Customer name Customer name

Address Address, city, postcode

Phone Phone number

Week total Total amount to pay for a week

Outstanding How much customer due since last visit

Week paid Amount paid current week

Pay type Payment type (cash/online)

Notes Notes for delivery

Holiday from Date from which customer is not able to receive order

Holiday stops Date from which customer is able to receive order

Table 2. Description of the delivery list.

When all deliveries are complete, information collected by the driver submitted to the

website. Driver hands in the paper to the manager at the office, who types in new values into

forms at the website.

18

Page 19: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

3.3 Requirement specifications

Based on the information collected requirements were specified.

The main security issues are considered on the online system, since it involves online

payment process. While the mobile application do not accept payment and there is no in-

formation which should be hidden. However, because the application connects to the web-

server to update the basic security methods should be implemented. User is required to

enter password in order to download and upload data.

Functionality and user interface were drawn up and summarized as follows:

The app must be able to download delivery information from the web-server. The app should store the downloaded information in local SQLite database.

o SQL query to insert new records into local database User should be able to view the entire list

o SQL query to retrieve data from the database User should be able to view each order in details User should be able to edit:

o Week paido Outstandingo Pay typeo Noteso Holiday fromo Holiday stops

SQL query to update the database records Since there are usually dozens of orders user must be able to mark completed ones

o Create an extra column in local database to hold this information Load and upload processes must be protected by passwords

o Store passwords and usernames in local database User should be able to change the password App must upload information from the SQLite database back to the server

According to the requirement the app is going to be used at delivery time, so this means

that the app usage should be simple and understandable. Having this the user needs to pass as

little amount of screens as possible and the app should have a little amount of buttons. How-

ever sizes of buttons and other clickable components should be large.

As it was said data is stored on the web server that’s why it should be copied from the

web database and written to the handset manually or written using wireless techniques. Ob-

viously, the wireless approach is preferable.

19

Page 20: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

20

Page 21: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

MyLocalFarm.co.uk

Web site MySQL database

PHP scripts

4 Planning and design

Once the requirements of the application are specified, analysis of the requirements will

lead to planning and design stage.

4.1 Overview

Since the existing system consists of PHP pages and the handset is a mobile device run-

ning on the Android platform the final system should consist of two parts. One is set of Java

and XML codes which runs app on the Android platform. The second is PHP scripts that

placed on the web-server and performs communication with the MySQL database on the

server. These scripts act as a bridge between handset and the web-server (Figure 6).

Figure 6. Interaction between system parts.

21

Page 22: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

Main screen

Load data

Upload to server

Show list

Change password

Figure 8

Figure 11

Client1, address1 Client2, address2 Client3, address3 Client4, address4…

4.2 User interface

The user interface was implemented by use of XML. Android environment allows de-

veloper to define the user interface in two ways “hard-coding” or by XML. First is easier to

read, but not convenient at the implementation. The second way is more flexible. XML

defines components, their positions, colors, sizes and even if it should be scrollable. De-

veloper can easily access to UI components via Java tools.

When the user starts the app welcome screen appears. It contains logo of the company.

This screen lasts 1.5 seconds then the main screen is loaded.

As it was specified in requirements there are four main tasks that user must be able to

perform using the app: download data from the server, view entire information about orders,

upload data back to the server and manage to change the password. According to this main

screen holds four buttons each for task.

Figure 7. Schema of the main screen

When user presses “Load data” orders information is loaded from the server. When “Up-

load to server” pressed it sends data back to the server.

To look at list of orders user needs to press “Show list” button. This takes user to a new

screen with a list of current orders. The screen is scrollable.

22

1, 09/09/11,
too early for this
Page 23: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

Please enter password

Submit

Figure 8. List of orders

To take a detailed look at the order user presses on one of them. The next screen shows an

entire details including full address, phone number, total amount to pay for a week, how

much customer due since last visit, amount paid current week, payment type, notes for deliv-

ery, date from which customer is not able to receive order, date from which customer is able

to receive order.

Figure 9. Order details

There is a button which should mark completed orders. So when user presses “Mark as

complete” button “Complete” sign appears on the order details.

When user tries to download or upload data to server user will be asked to enter a pass-

word or a key word.

Figure 10. Password request 23

Name

_________________________

Address

_________________________

Phone

_________________________

Week total

_________________________

Pay type

_________________________

Notes

_________________________

Holliday from

_________________________

Holliday stops

_________________________

Mark as com-

Page 24: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

Enter old password

Enter new password

Confirm new password

Save Cancel

In order to change this password user presses “Change password” button. This will show

a screen for password changing (Figure 11).

Figure 11. Change password

4.3 Integration with database

As it was previously mentioned user should be able to access information from the web-

site. Since there is a big amount of data and they might be of different type database should

be used. For Android phones SQLite database is an embedded database engine. Database

should contain orders information and the passwords as well.

The database consists of two tables. The first is orders table, which contains orders in-

formation. The table has following fields:

Name Descrption

ID Identifier of am item (local, not the Web database identi-fier)

Firstname First name of the customer

Lastname Last name of the customer

Cb_houseno House number

Cb_street Street name

Cb_city Name of city

Cb_zipcode Postcode

Cb_phone Phone number

Cb_weektotal Total amount to pay for a week

Cd_outstanding How much customer due since last visit

Cb_weekpaid Amount paid current week

Cb_paytype Payment type (cash/online)

Cb_notes Notes for delivery

24

Page 25: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

Cb_holidayfrom Date from which customer is not able to receive order

Cb_holiday_stop Date from which customer is not able to receive order

Dr_complete Date from which customer is able to receive order

The second table named userkey has only two columns ID and key_word. This table con-

tains the password which user needs to enter in order to communicate with the server.

4.4 Security

As it was told earlier the application neither does payment operations, nor stores critical

information. This means that no specific security considerations have to be taken into ac-

count. However, it does not mean that the application can be left totally insecure. One of the

tasks is to access data from the website. The application downloads data about orders and

then uploads updated data back to the server. So the consumer data on the web-server is go-

ing to be updated. To avoid any unexpected update, actions concerning the web access must

be protected with password. In order not to affect the application speed, password should be

stored locally on the handset.

The password is stored in the userkey table. When application first started after installa -

tion the initial value is set for password. After this user can change the current password. To

do this user presses appropriate button on the Main screen. So the value in the table will be

updated.

In case of user forgets current password and not able to change it there is a backup pass-

word as well. This password is static, user can use it anytime.

4.5 Communication with the web-server

To get the data to operate with the app needs to connect to the web-server. The applica-

tion sends HTTP-POST request and invokes a php script. All scripts are stored on the server.

The script connects to MySQL server and retrieves data about deliveries for current system

date. If there is no delivery the script returns null, otherwise the data selected is transferred

into suitable format and written into the file on the server side. After this, application down-

loads a file stream from the server. Once the file stream is ready the application connects

to the SQLite database and inserts data into appropriate table (Figure12).

25

Table 3. Fields of Order table.

Page 26: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

Figure 12. Downloading process

While performing the opposite operation, i.e. uploading, application retrieves data from

the local database of the handset and stores it into output stream. The output stream is then

sent by the HTTP-POST request to the server. Again at the server side another php script is

invoked. This time it writes the uploaded data into appropriate table of MySQL database on

the server side.

Figure 13. Uploading process

26

Page 27: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

5 Implementation

This chapter will discuss implementation of every part of the application. Detailed look

will be taken at user interface and background processes.

5.1 Welcome screen

When the application started initial screen shows company’s logo. This screen lasts for

only 1.5 seconds. After this the activity’s thread is stopped and the main screen is loaded.

Figure 14. Welcome screen

5.2 Main screen

The main screen contains four buttons which perform main tasks.

27

Page 28: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

Figure 15. Main screen

Load data button request an authorization. After successful authorization the app invokes

a PHP script by HTTP-POST request, which connects to the web database and selects appro-

priate data. Then this data is inserted into phone’s database.

Figure 16. Loading data from the server

5.3 List of orders

After loading the data user supposed to start working with it. So the user presses Show

list button. This takes the user to another screen with the list of deliveries. List is read from

the handset database and displayed. Each row shows address of the customer restricted by 15

characters. This restriction is dictated by presence of incorrectly submitted addresses. Some

users entered street names and city names several times. Initially row contains the address

28

Page 29: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

only. After marking the order as complete the row will have a word “Complete” in front of

address. This will be discussed later.

Figure 17 List of orders

5.4 Order detailsIn order to take a look at the order details user presses on the item. This takes the user

into details screen. This screen shows all the necessary details about the order which has

been discussed earlier. However some fields has specific image near the value. These are

fields that are supposed to be changed by the user at the time of delivery. When the user

presses on the field a new dialog box is created. Once the user submits a new value applica-

tion connects to the local database and updates the appropriate table. When the user updates

the payment type, the app displays a drop down menu which has two values: “Online” and

“Cash”. This avoids extra typing. When scroll down the users see a “Complete” button. If the

user presses this button the value of dr_complete column in the orders table changes to Com-

plete. So when the user goes back to the list of orders the order which is marked complete,

will have a sign of completeness. This makes it easier for the user to distinguish if the order

is still due or done. However, the sign of completeness is not uploaded to the server, because

obviously the web database does not have such column.

29

Page 30: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

Figure 18 Order details

Figure 19. Drop down list

5.5 Uploading to the serverAt the end of the day when all deliveries are complete the user may upload the new data

back to the server. For this the user needs to press Upload to server button. So app writes all

data retrieved from the local database into locally created file. The file is store in data/data/

30

Figure 20. Edit field value

Page 31: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

package name/files/ directory in the handset file system. Then HTTP-POST request uploads

the file to the server where a specific php script stores the file into server’s folder.

Figure 21. Upload data back to the server

5.6 Changing the passwordAs it was mentioned before the user needs to enter a password to upload or download

data. To avoid the lost of password the application allows the user to change the password.

User presses the Change password button on the main screen and the appropriate screen ap-

pears. The user required to enter the current password and enter new one two times. The app

checks the value of current password, if matches, checks if new password and confirmation

are equal. If everything is ok, the value of password is updated.

31

Page 32: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

Figure 22. Changing the password

5.7 Fault toleranceA fault tolerant system is a system which continues to function regardless for failure of a

certain component. This project displays a message for user about the failure. There several

places where fault may occur, like lack of connection or bad password.

When downloading or uploading data in the case of connection problems with the server,

Toast message is shown to the user and application continues functioning

Figure 23. Error in connection

When the user enters password, the application checks if the value matches one in the

database. If yes, appropriate screen is displayed otherwise app lets the user know.

32

Page 33: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

Figure 24. Wrong password

When user submits empty text for any editable field, it is assumed that nothing has to be

changed, the current value is not altered for NULL or something, but the following message

is shown.

Figure 25. Empty field

33

Page 34: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

6 Testing

Testing is a very essential part of application development because it helps to define fail-

ure and allows knowing if the development is going the right way.

Many features were added and improved while developing. Any chance to discuss current

achievements with the client was used profitably. And this really helped because initial re-

quirements were too rough. So those discussions were kind of initial testing. For example

originally the main screen holt a list of deliveries and the rest of action were available

through it, but then it was told that it is better to divide tasks into four main groups, because

obviously there is a lack of time at delivery and everything should be accessed easily.

The first testing was done on the Android phone. It was a very useful testing, because it

defined problems with screen sizes. The Android Emulator’s screen resolution does not al-

ways feet the real screens. So the components positioning was improved. Also after this try

client came up with some feedback. They would like the holiday date to be editable as well.

So this was done. Also client asked the full address to be shown on the screen with the list.

However, as it was told before there are some customer details have incorrectly long ad-

dresses, so this feature is set to be improved in the future when the customer details on the

web site will be improved.

It was very difficult to organize testing because of busy schedule of client and the com-

pany’s driver. However the second testing was arranged, though it was the last. This testing

showed that client is very happy with the application. The company’s owner and the driver

participated this testing. It was told that the app is what the client expected and more. Espe-

cially driver was very pleased that there no more need to print the hand outs and type them

back again. Also they asked if the holiday date component might be changed to Calendar

View component. This was left to the future development because of lack of time for further

development.

34

Page 35: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

35

Page 36: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

7 Conclusion

This dissertation project has produced a usable application for MyLocalFarm.co.uk, based

on the Google’s Android platform.

Company wanted to optimize the delivery process. So that while out of office driver may

maintain list of deliveries by the app on the handset. Since company staff already had An-

droid phones the corresponding platform was chosen. The features of the app include down-

loading the list of deliveries from the web server and uploading back to the web server. As

well as viewing the order details user also may edit some fields. For security considerations

password protection was added at downloading and uploading data from the server.

The client is very pleased with features that are implemented at this version of the applic-

ation. Especially at the testing period driver, who is a target user, was very enjoyed with the

uploading feature because it reduced another typing work at the end of every working day.

Also client shared some ideas for future expanding of the project.

As for developer this project was a big challenge. The first reason is that before the pro-

ject I did not have mobile development experience and I did not take any especial Android

module during the MSc course. Secondly, although, Android is quite new in the market the

new versions come rapidly and it was a bit confusing at first.

While developing the project it was found that Android is a very flexible platform offer-

ing a wide range of libraries and features. And it was an extremely useful experience to have

in mobile phone developing.

7.1 Evaluation

Evaluation needs to be done in order to make sure that new things were learnt while de-

veloping the project.

The design and planning part was done well.

The implementation was divided into two parts. First includes user interface and integra-

tion with database. Database principles and application course which was taken during MSc

program really helped at this stage. Developer felt confident in this area. However lack ex-

perience in XML environment caused some confusion at developing the user interface. The

code suffers some insufficient usage of XML syntax.

The second part is a web based development. At this point PHP scripts were used. This

part was challenging as well, because developer did not have previous php developing exper-

ience. This technology was learnt while doing the project.

While transferring the data between handset and the web-server the app uses simple text

files. Since php scripts and Java part of the app understands text file the project uses this ap-

36

Page 37: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

proach. However, developer had doubt about its efficiency. Probably it is not the most effect-

ive way to transfer and in the future this can be altered.

Currently company has only one driver, so no multi user requests were handled on the

server side. This feature can be added in the future as well.

7.2 Future work

In this kind of projects there is always a solid scope to expand the application. And this

depends on the client’s business is going to change in the future.

But there are still some obvious areas to work on. For example as it was mentioned before

currently company has only one driver, so the application handles web request only one at a

time. However if number of drivers increases data that extracted from the web database must

to managed carefully in order to avoid collision. The process of writing the data into file on

the server side should be synchronized.

At this version no map or GPS facility was implemented. This is because driver often

goes to areas with no internet or mobile connection. So this feature might not useless. How-

ever if company wishes it can be added easily to the app. There a Google’s Map API which

handles map facility.

Also I would add accepting the online payments to the app. For instance, if client does

not have any cash at the moment of delivery the driver may advice to make payment online.

However this would require an Internet connection available.

Finally, the app can be extended as generic application which might be used by other

businesses. It might be integrated with other systems.

37

Page 38: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

38

Page 39: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

References

[1] Google’s Android becomes the world’s leading smart phone platform, http://

www.canalys.com/newsroom/google%E2%80%99s-android-becomes-world%E2%80%99s-

leading-smart-phone-platform , July 2011

[2] Smartphone definition, http://www.businessdictionary.com/definition/smart-

phone.html, July 2011

[3] Smartphones: A look at the app count, market share disconnect, http://www.te-

chrepublic.com/blog/smartphones/smartphones-a-look-at-the-app-count-market-share-dis-

connect/264, July 2011

[4] Report: Apple remains king of app-store market, http://news.cnet.com/8301-13579_3-

20032012-37.html, July 2011

[5] Courier complete, http://www.couriercomplete.com, July 2011

[6] Packetracer for Android, http://www.mobabel.net/mobabel/node/428, July 2011

[7] Android developers websire, , http://developer.android.com/guide/developing/

devices/emulator.html, June 2011

[8] SQLite database website, http://www.sqlite.org/, June 2011

[9] PHP website, http://php.net, June 2011

[10] MySQL definition, en.wikipedia.org/wiki/MySQL, June 2011

Mobile application on Android platform for van drivers39

Page 40: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

to maintain customer records

Feedback gathered at user testing

S.Mustafa - 1927635

August 2011

IntroductionThis section contains feedback which was gathered at testing. Two people parti-

cipated the testing and this section holds both of questionnaire.

40

Page 41: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

41

Page 42: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

42

Page 43: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

43

Page 44: Sample Dissertation Format - Computing Science and ... Web viewDissertation submitted in partial ... Since drivers are provided with phones on Android platform, company wants a mobile

44