Assignment Submission

CET325 Advanced Mobile Development

2015-16

Name: Istvan Franko

userID: bg47bp

Reg num: 1106307422

Programme: Computing

 

 

 

1. Introduction

This task has set the goal to learn about the details of mobile application development. The program has introduced to Mobile Ecosystem, Native and other methods of programing. It have also gained valuable information about Mobile Operation System and their basics and requirements. It has introduced programming languages, design and development tasks.

To use and show the information that's mentioned above, to develop an application with specific functions built in. The application has included every important detail which was included in the program.

This document summarises this criteria and guides you through the process of application development step by step.

2. Analysis

The analysis looks at the characteristics and expectations of a modern mobile application. These skills are essential for the development of a well-functioning advanced applications.

2.1. Mobile Ecosystems

The Mobile Ecosystem, a collection of environmental features, which includes mobile devices such as phones, tablets and other general functions. It includes the manufacturers, providers’ application and the tools, programming languages and operating systems for their development. These definitions allow for cross platform communication. This in fact, ensures that the users are able to access applications created by the developers. The main categories are Native, HTML5 and Hybrid programming environment.

International Journal of Computer Science & Information Technology (IJCSIT) Vol 7, No 1, February 2015

A native application provides fast and easy access to the app store, but usually it is not multi-platform. In contrast, the Hybrid and Web based applications run on most platforms (de Andrade, Albuquerque, Frota, Silveira & da Silva 2015).

In the current market there are 2 main competitors. Apple and Google dominates the market, but due to the opportunities provided by the open source code, the scale is tipping towards Google's Android (Bergvall-Kåreborn & Howcroft 2014).

The importance of Mobile Ecosystem demonstrated by the revenue already making up a significant percentage of GDP (GSMA 2015)

Source: http://www.gsmamobileeconomy.com/GSMA_Global_Mobile_Economy_Report_2015.pdf (Accessed: 31-12-2015)

2.2. Native development

Native development is when the mobile application is developed for a specific mobile device using its own programming language and it is installed on that specific device. For the different platforms, a different version of the application has to be developed. The most common languages are C based, .NET and Java scripts. The different operating systems require different knowledge.

Although the publication is 4 years old and the ratio and version numbers have changed, it still shows the importance of the Java language (Charland & Leroux 2011).

2.3. Mobile Operating Systems

Jyothy and Shinto (2013) published a study, titled ‘Mobile OS – Comparative Study’ in Journal of Engineering, Computers & Applied Sciences (JEC&AS). The publication discussed operation systems made for available and safe mobile platform.

The study was carried out by statistical analysis, and it included users' experience and security services. It summarised the share of operating system between January 2009 and 2013 in a table.

The above mentioned systems were stated in the table:

  • iOS
  • Android
  • Symbian OS
  • Black Berry OS
  • Series 40 (Nokia)
  • Samsung
  • Unknown
  • Sony Ericsson
  • Other

The following data need to be underlined. iOS continuously owned an estimated 30% of market share. After the initial 0.66% share, Android got closer to 40% with continuous development in the end. Black Berry OS was increasing until 2010, reached its peak in 2011. However, its share has been decreasing since then and fell to 3% by 2013. Samsung step into the market in 2009, and increasing until the end of when it reached 6.5%. It went down to under 5% in the following quarter.

The study pointed out the following ascertainment. Android system is based on Linux Kernel. Main programming language is Java. Android OS is an open source platform system and its one of the foremost developmental aspects is security what has been made flexible by multi-layered security levels. Currently, it is considered as one of the safest operating systems. iOS was developed by Apple following the tradition of MAC OS. The most important concern is the user-friendly interface. Personal data is protected by encoding. Applications are restricted by users' permission. It supports the encoding of network communication. Lost or stolen devices can be found on map, and personal data can be deleted remotely, and devices can be completely blocked. Operating system of Microsoft Windows Phone 8 is also worth to be mentioned. Although it is not a key product on the market but it constantly presents. Its security features are device and data encoding, data leak prevention and digital signature. (Jyothy & Shinto 2013)

An up-to-date table was published on IDC Research, Inc. website.

Source: http://www.idc.com/prodserv/smartphone-os-market-share.jsp

According to these tables, Android gained 80% market share in 2014 and it keeps this level with small fluctuation. It causes the decrease of iOS share to under 20%. These numbers show that other market actors do not have significant share on Mobile Operating Systems market.

Review of operating systems points out that devices running Android OS are significant. They meet all challenges in terms of security, too. From the view of our project, it means that developments need to be focused on these devices.

2.4. Programing Languages

There are a number of tools to help with mobile application development, but these tools are made for only few of the programming languages. These include Jave, C and HTML. Sometimes it's a combination of these, for example PhoneGap, MoSync and Game Closure. For easy development there are segmented tools, such as AppInventor, which makes it easy to develop basic applications without any knowledge of programming (Luterbach & Hubbell 2015).

Top 10 Mobile Development Programming Languages

top programming languages 2014

Source: IEEE Spectrum’s 2014 Ranking

2.5. Storage Designs

Different mobile operating systems store the application and the user’s data in various ways. In the following the main attributes of the two main operating system, iOS and the Android is listed.

In the case of the iOS the file storage is taken care of by the operating system, the user does not have direct access to this data. The iOS protects the apps access with different levels of security and it provides further protection by using a Sandbox architecture. The Sandbox technology means that the data is in containers. Normally the app does not access any data outside its container (iOS Security Guide 2015)

The following table shows the directories usually used under the iOS (iOS Developer Library, File System Programming Guide 2016)

Table 1-2 Commonly used directories in OS X

Directory

Usage

/Applications

This directory is where you install apps intended for use by all users of a computer. The App Store installs apps purchased by the user in this directory automatically.

The Utilities subdirectory contains a subset of apps that are intended for use in managing the local system.

This directory is part of the local domain.

Library

There are multiple Library directories on the system, each one associated with a different domain or specific user. Apps should use the Library directory to store app-specific (or system-specific) resources.

For detailed information about the contents of this directory and how you use it to support your apps, see The Library Directory Stores App-Specific Files .

/Network

This directory contains the list of computers in the local area network.

There is no guarantee that files located on network file servers will have the /Network directory at the beginning of their path. Path names vary depending on several factors, including how the network volume was mounted. For example, if the user uses the Connect to Server command to mount a volume, paths begin with the /Volumes directory. When writing code, assume that files on any volume other than the boot volume could be located on a network-based server.

/System

This directory contains the system resources required by OS X to run. These resources are provided by Apple and must not be modified.

This directory comprises the contents of the system domain.

/Users

This directory contains one or more user home directories. The user home directory is where user-related files are stored. A typical user’s home directory includes the following subdirectories:

  • Applications —Contains user-specific apps.
  • Desktop —Contains the items on the user’s desktop.
  • Documents —Contains user documents and files.
  • Downloads —Contains files downloaded from the Internet.
  • Library —Contains user-specific app files (hidden in OS X v10.7 and later).
  • Movies —Contains the user’s video files.
  • Music —Contains the user’s music files.
  • Pictures —Contains the user’s photos.
  • Public —Contains content the user wants to share.
  • Sites —Contains web pages used by the user’s personal site. (Web Sharing must be enabled to display these pages.)

The preceding directories are for storing user documents and media only. Apps must not write files to the preceding directories unless explicitly directed to do so by the user. The sole exception to this rule is the Library directory, which apps may use to store data files needed to support the current user.

Of the subdirectories, only the Public directory is accessible by other users on the system. Access to the other directories is restricted by default.

Source: https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html

 

The Android's data storage methods are much easier to personalise. The applications can use one of the following ways to use the most appropriate approach. (Android Developers, Storage Options 2016).

  • Shared Preferences (The data is stored in pairs of Key-Values)
  •  Internal Storage (In this case the information is stored on the phone's memory. so the command getFilesDir() has to be used)
  • External Storage (This is the removable storage, so it's not always accessible).
  • SQLite Database (with this, the internal file system is used to create a virtual database, and the relevant information is stored here)
  • Network Connection (gives an opportunity to connect to external databases and store data there)

2.6. iOS Core Design Principles

According to the iOS Developer Library, the developers have to take the following elements into consideration when creating an application (iOS Developer Library, Design Principles 2016).

· Aesthetic Integrity (This means that the application matches in its graphics and it's messages)

· Consistency (Consistency is important, as it makes it easier to use for the user e.g. navigation functions are in a consistent position)

· Direct Manipulation (These are solutions that make it easier to use, for example multi touch manipulation)

· Feedback (The UI reacts and responds to the actions of the user eg. button press indicating animation)

· Metaphors (Uses close to real life solutions that help the user, for example dragging, flicking etc.)

· User Control (When there is an important change, we are asking for permission from the user, such as a popup alert box)

2.7. Android Core Design Principles

The android design principles are made up from three main parts. These principles are analysed in the following (Android Developers, Design Principles 2016).

Enchant Me

· Delight me in surprising ways (The use of multimedia options for a more enjoyable use, for example good quality animations, sound effects)

· Real objects are more fun than buttons and menus (Using graphical pieces rather than simple buttons)

  • Let me make it mine (personalisation)

· Get to know me (show previous choices for easy repeating)

Simplify My Life

  • Keep it brief (simply words)

· Pictures are faster than words (minimalised text)

· Decide for me but let me have the final say (suggestion)

· Only show what I need when I need it (basic structure)

  • I should always know where I am (navigation)

· Never lose my stuff (save data and access for other apps)

  • If it looks the same, it should act the same
  • Only interrupt me if it's important

Make Me Amazing

· Give me tricks that work everywhere (similar manipulation solutions made for similar tasks)

· It's not my fault (accurate description of errors and problem troubleshooting guide)

· Sprinkle encouragement (to break down complex tasks into simple ones)

· Do the heavy lifting for me (to make difficult tasks simple)

· Make important things fast (ease of access to important functions)

2.8. iOS and Android Principles Comparison

If we wish to develop a multiplatform application, and we want to comply with both the iOS and Android design principles, then we have to take the following into consideration (Pantel 2012).

Similarities:

  • Similar information structure;

· Basic user interface elements (sliders, checkboxes, tabs, text boxes.);

  • List-based navigation system;
  • similar gesture touch controls (like tap and hold, or dragging and flicking)

Differences:

· Back button and navigation (in iOS placed in upper left corner, Android has two types “Up” is placed in upper left corner and “Back” as a psychical button at the bottom bar)

· Navigation bar (in iOS placed at the bottom, in Android recommended to place at the top)

· Data views (iOS usually prefer bar view and Android use “spinner” list box)

· Actions bars (similar like navigation bar)

· Screen sizes (iOS mobile devices have not a lot of screen sizes and resolution, Android mobile devices have a larger list of screen sizes and resolution)

3. Design

In this chapter we will analyse the design of applications. Throughout the development, we will try to follow the guidelines given by Android when possible.

3.1. Screen Hiearchy

The full size picture is downloadable with click on picture!

3.2. Design Wireframes

 

In the last academic year we have had a similar application development project, where I have used Action Script 3.0 as the programming language. Due to the similarities between the projects, I could use previously made images and the base structure, there was no need to create many new ones, and therefore they were readjusted.

3.3. Menu Details

As the software is simple, it was unnecessary to create a complex menu system. There is only two menus in the whole software.

One in the starting screen, a settings menu where there are options for changing the username, deletion of the complete database or to load samples for testing purposes.

The second one is at the Pedometer page, where there is also a settings menu where step and distance, pause, reset and adjustments can be made.

 

 

 

 

3.4. Layout Details

The software’s layout structure is illustrated by this image.

 

 

 

 

 

 

 

 

 

 

As seen on the image, many activities have 2 versions. This is to orient the screen into portrait or landscape view and to ensure that a number of functions are still shown.

Outside of the activities layout there are different views to display the full and short list's content and their positioning.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

For a perfect way to show the screen, there are 12 different resolutions added to determine the position of text and images.

 

 

 

 

 

 

 

 

 

 

 

 

 

Also different graphical buttons are made of 12 kinds of resolutions.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

To make the spectacular scene transitions are animated using various ways.

Intent UserName = new Intent(this, EditUserName.class);

startActivity(UserName);

// Alpha transition



overridePendingTransition(R.anim.fade_in, R.anim.fade_out);




 

3.5. Media Resources

Most of the image based functions are made by me using Photoshop. Only on the ''Edit Work'', there can be three graphical icons found that are not my own. These were found by Google Search and they are picked from free to use icons.

3.6. Interaction Requirements

As the software was not created for a large number of mixed users, it was created for the goals of a small groups personalised use, therefore the main attribute of the software is ease of use and simplicity.

Taking the above into consideration, there is not a need for any interaction requirements. All functions can be easily interacted with by using a single finger, touch. Upon turning the device, the only change that occurs is that all functions are repositioned, so everything is still visible and functioning.

3.7. Design Evaluation

The Android Developer defined design principles are taken into consideration, where it was possible graphical icons were made instead of using simple buttons. The ease of use was applied to three databases (Bookings, Customers, Dogs), which all use similar structure, so that they are much easier to learn for the user. To make the navigational structure simple, every basic function is accessible from the starting page and from there, every extra function is reachable within 3-4 steps.

With the methods above we could create a software that has many uses, but is also very simple to use.

4. Functionality

4.1. Functions

Most of the image based functions are made by me using Photoshop. Only on the ''Edit Work'', there can be three graphical icons found that are not my own. These were found by Google Search and they are picked from free to use icons.

 

 

 

 

 

All of the software’s functions can be accessed from this screen, with the help of graphical buttons.

The ''View Booking'' page is a list of all the bookings and there is an opportunity to search for it by date.

With the use of ''Add New Booking'' page spinners and buttons aid to minimise the number of errors in case of wrong input.

The ''Edit Booking'' page gives a shortened list of the bookings. A search by date can also be utilised here.

Clicking on one of the entries in the short list, it will take the user to the edit page. Here any editable information can be edited as well as the deletion of an entry.

The ''View Customer'' page a list of costumers can be viewed and they can be searched by name.

The ''Add New Customer'' page allows the user to add a new customer's details.

The ''Edit Customer'' page shows a short list of the current customers and searching by name is also an available option.

Clicking on one of the elements here will transfer you to the desired customers edit page. Customer details can be edited or deleted here.

The ''View Dog'' page shows a list of dogs, where their data can be viewed and there is a search by name option too.

The ''Add New Dog'' page can be used to add the details of a dog. The owner can be chosen from a snipper, so we can add the dog to an existing customer.

The ''Edit Dog'' page, similarly to the previous edit page a short list of the dogs can be found, and they can be searched by name here too.

Clicking one of the items on the list, it moves us to the edit page of the dog, named ''Dog Details''. The data regarding the dog can be edited or deleted here.

The ''Start Work'' page shows a list of all work that has not been started yet on actual date.

 

 

 

 

 

 

 

 

 

We can confirm the start of the work selected by clicking on one of the elements of the list in a pop-up window. The programme automatically record the start of the work in the database. User is not able to modify it.

If we have a work started, extra content related to the work can be added on the ’Edit Work’ page. In any other cases, a pop-up window warn that we can only add extra content to work started.

 

 

 

 

 

Clicking on the camera icon, we can get to the ’Take a Picture’ page. Pictures can be taken by the built-in camera and they can be sent to the customer’s email address via email or can be shared with a person chosen from our friends via Facebook Messenger.

Clicking on the map icon, the system uses the built-in sensors to have an access to coordinates to be able to specify our location. After accepting the specified address, it will be saved and matched to the current shift.

Clicking on the icon of distance covered, we can get on the page of Pedometer the system uses the built-in sensors to calculate the distance covered. Counter can be stopped, reset and set precisely from the menu. Distance covered can be also saved into the data of shift started in the database.


 


Last function is the finish of current shift. If we click on ’END WORK’ button, we will be able to confirm the finish of the shift in a pop-up window. The ending time will be automatically saved.

4.2. Storage Requirements

The application stores data in three places: in SharedPreferences, on default memory, in SQLite built-in database.

Variables of the application is stored in SharedPreferences such as

  • User’s name
  • ID of shift started
  • Values of the Pedometer

Photos taken by the application are saved in the ’ImageApp’ folder on the default memory.

Data, what is needed to be stored for a longer time, is saved into the SQLite. Bookings, customers’ and dogs’ data can be found here.

4.3. Database Structure

Important data of the application is saved into a database but into three spreadsheets. Different spreadsheets store the Bookings, the Customers’ data and the Dogs’ data. This structure has been required because a customer can have more than one dog and reservations. In this way, not all data should be stored repeatedly


 


The whole database is managed in the MySQLiteHelper.java so we can access to all data by using it.

Deletions were linked together because of perfect run of the programme. For example, if we delete a user, their dogs will be also deleted to avoid dogs without owner.
 


Tables and fields:

allCustomers:         
 
·         CustomerID: "INTEGER PRIMARY KEY AUTOINCREMENT"
·         CustomerName: "TEXT"
·         CustomerPhone: "TEXT"
·         CustomerAddress: "TEXT"
·         CustomerEmail: "TEXT"
·         CustomerNotices: "TEXT"
allDogs:  
 
·         DogID: "INTEGER PRIMARY KEY AUTOINCREMENT"
·         DogName: "TEXT"
·         DogType: "TEXT"
·         DogAge: "INTEGER"
·         DogCustomerID: "INTEGER"
·         DogChipNumber: "TEXT"
·         DogNotices: "TEXT"
·         DogPictureURL: "TEXT"
 
 
allBookings:           
 
·         BookingID: "INTEGER PRIMARY KEY AUTOINCREMENT"
·         BookingState: "INTEGER"
·         BookingCustomerID: "INTEGER"
·         BookingDogID: "INTEGER"
·         BookingType: "INTEGER"
·         BookingPictureURL: "TEXT"
·         BookingAddress: "TEXT"
·         BookingWalkingDistance: "TEXT"
·         BookingDate: "TEXT"
·         BookingTime: "TEXT"
·         BookingStartedTime: "TEXT"
·         BookingEndTime: "TEXT"
·         BookingNotices: "TEXT"
 

4.4. Application’s file structure

File structure of the application can be seen below. The function of important ones is put in brackets.

· <DIR> db (for database automated testing only)

  • <DIR> preferences (Pedometer preferences)
  • AddBooking.java
  • AddCustomer.java
  • AddDog.java

· BookingDB.java (class for Booking objects)

· CustomerDB.java (class for Customer objects)

  • DetailsBooking.java
  • DetailsCustomer.java
  • DetailsDog.java
  • DistanceNotifier.java

· DogDB.java (class for Dog objects)

  • EditBooking.java
  • EditCustomer.java
  • EditDog.java
  • EditUserName.java
  • EditWork.java

· GPSService.java (Location service)

  • HomeScreen.java
  • MySQLiteHelper.java (Helper for database)
  • PaceNotifier.java
  • PedoMeter.java
  • PedometerSettings.java

· Settings.java (Settings for Pedometer preferences)

  • SpeedNotifier.java
  • StartWork.java
  • StepDetector.java
  • StepDisplayer.java
  • StepListener.java (Interface for Pedometer)
  • StepService.java
  • TakePicture.java

· Utilities.java (for database automated testing only)

· Validation.java (User input validation class)

  • ViewBooking.java
  • ViewCustomer.java
  • ViewDog.java

4.5. Validations

User entries of the application was checked in 'Validation.java' class. Check of content of text fields is possible here. It can be checked whether required fields contain data, email address and telephone number are in the correct form or length of number of dog chip is correct. All other activities use this class for validation.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

package com.example.fpisti35.walkies;

import android.widget.EditText;

import java.util.regex.Pattern;

/**
* Created by Fpisti35 on 25/12/2015.
*/


public class Validation {
// Regular Expression
// you can change the expression based on your need


private static final String EMAIL_REGEX = "^[_A-Za-z0-9-\\+]+(\\ .[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
private static final String PHONE_REGEX = "\\d{3}-\\d{8}";
private static final String CHIP_REGEX = "\\d{15}";

// Error Messages


private static final String REQUIRED_MSG = "required";
private static final String EMAIL_MSG = "invalid email";
private static final String PHONE_MSG = "###-########";
private static final String CHIP_MSG = "###############";

// call this method when you need to check email validation


public static boolean isEmailAddress(EditText editText, boolean required) {
return isValid (editText, EMAIL_REGEX, EMAIL_MSG, required);
}

// call this method when you need to check phone number validation


public static boolean isPhoneNumber(EditText editText, boolean required) {
return isValid (editText, PHONE_REGEX, PHONE_MSG, required);
}

// call this method when you need to check dog's chip number validation


public static boolean isChipNumber(EditText editText, boolean required) {
return isValid (editText, CHIP_REGEX, CHIP_MSG, required);
}

// return true if the input field is valid, based on the parameter passed


public static boolean isValid(EditText editText, String regex, String errMsg, boolean required) {

String text = editText.getText().toString().trim();
// clearing the error, if it was previously set by some other values


editText.setError(null);

// text required and editText is blank, so return false


if ( required && !hasText(editText) ) return false;

// pattern doesn't match so returning false


if (required && !Pattern.matches(regex, text)) {
editText.setError(errMsg);
return false ;
};

return true ;
}

// check the input field has any text or not
// return true if it contains text otherwise false


public static boolean hasText(EditText editText) {

String text = editText.getText().toString().trim();
editText.setError(null);

// length 0 means there is no text


if (text.length() == 0) {
editText.setError(REQUIRED_MSG);
return false ;
}

return true ;
}
}
 

Besides input fields, value of spinners is also checked in case of its change. A 'Toast' message warns the user when required data is missing. Every change of spinner changes data of other spinners to avoid errors. For example, after selecting a customer, only dogs will be showed and be able to be selected which are owned by the customer. Another example can be when we change the customer we must also change the dog to avoid mixing the connection of owners and dogs.

// Check customer and dog changed together or does not changed

if ((customerChanged == true && dogChanged == true) ||

(customerChanged == false && dogChanged == false) ) {
 


4.6. External Programs, APIs

The following expansions, software were used for the development of the application. During the development of application, knowledge, gained in lectures and seminars, and codes, written and got then, were used as a base.

Database unit testing

 

Easy SQLite With Unit Testing by Hafiz (2014) was utilised for testing the database.

Facebook Android SDK

 

Getting Started Android SDK manual of Facebook for developers (2015) was also helped to be able to integrate the Facebook Messenger into the software. The newest 4.8.2. version did not consist of Android Studio support so a previous version, 4.1.0. was integrated.

Location manager



Android GPS, Location Addressing using Location Manager Tutorial of Wingnity Team (2014) was followed for development of Location Manager Function.

 

Pedometer



Pedometer is based on a free full software. Codes, what we needed, were separated from the software and their modified versions were integrated into our system. (Bagi 2010)


5. Test Strategy and Test Results

During the development of the application, after modules’ or functions’ each encoding. Their function and integrity were checked. High need of any repair was not required at the end because of the continuous check.

In most cases, functions of the software were tested on a Nexus 7 (2102), API 18, resolution 800x1280:tvdpi, virtual tablet because this had been proved to be the fastest.

Besides virtual devices, the system had been installed on my One Plus One, Android 5.1.1, screen resolution 1080x1920 and WayteQ xTab 9, Android 4.4.4, resolution 1280x1920 tablet, and every error was corrected which had been identified. All functions of the application were functioning without any error on these devices.


 


The application was also installed on Nexus 9, Android 6 tablet provided by the university. Location Manager could not been run on this device. There was not any problem with other functions. This device was only provided for limited time so finding and solving the problem was not possible but it might have been a permission problem because every other device run without any problem.


 


For this document, screenshot was taken of every screen by Nexus 5, API 19, 1080x1920:xxhdpi virtual mobile. Meanwhile, system was rechecked and few errors ware corrected. Although the errors ware minor.

Beside the aforementioned functions, an automatic test was also developed in the application what was described below.


 


5.1. Instrumentation Testing

Several activities can be found in the software so it was not possible to test all of them.
Automatic test was created for testing the four most-used activities.

 

  • HomeScreenInstrumentationTest
  • AddBookingInstrumentationTest
  • AddCustomerInstrumentationTest
  • AddDogInstrumentationTest

All of the four test files tested the Activity, setup. A Text field as well as a button were tested in instrumentation Unit Test.

All of the four tests had similar structure, only integrated one into the document.

package com.example.fpisti35.walkies;

import android.app.Activity;
import android.test.ActivityInstrumentationTestCase2;
import android.widget.ImageButton;
import android.widget.TextView;

/**
* Created by Fpisti35 on 24/10/2015.
*/






public class HomeScreenInstrumentationTest extends ActivityInstrumentationTestCase2<HomeScreen> {


private Activity mHomeScreen;
private TextView mTextView;

private ImageButton btnEndWork;


public HomeScreenInstrumentationTest() {
super ("com.example.fpisti35.walkies",HomeScreen.class);
}


@Override
public void setUp() throws Exception {
super .setUp();
// Get the activity instance


mHomeScreen = getActivity();
// Get instance of the editText box





mTextView = (TextView)mHomeScreen.findViewById(R.id.textWelcome);

btnEndWork = (ImageButton)mHomeScreen.findViewById(R.id.btnEndWork);

}

@Override
public void tearDown() throws Exception {
super .tearDown();
}

public void testPersistentData(){
mTextView = (TextView) mHomeScreen.findViewById(R.id.textWelcome);
final String p = "Istvan";

btnEndWork = (ImageButton)mHomeScreen.findViewById(R.id.btnEndWork);

// To access UI via an instrumentation test you must use
// runOnUiThread() and override the run() method




mHomeScreen .runOnUiThread(new Runnable() {
@Override
public void run() {
mTextView .setText(p); // test add text


btnEndWork .performClick(); // test button click


}
});

// Close the activity and see if the text we sent to mEditText persists


mHomeScreen .finish();
setActivity(null);

// Re-open the activity


mHomeScreen = getActivity();
String q = mTextView.getText().toString();

// Check the value in editText after re-opening matches our expected value


assertEquals (p, q);
}
}
 

Test results

 

 

HomeScreenInstrumentationTest

 

AddBookingInstrumentationTest

 

AddCustomerInstrumentationTest

 

AddDogInstrumentationTest

 

 

 

5.2. Stress Test

Monkey method was used during the stress test. The following commands were run in the command line.

cd C:\Users\Fpisti35\AppData\Local\Android\android-sdk\platform-tools

adb shell monkey -p com.example.fpisti35.walkies -v 2000

The test was run more than ten times, and 2000 touches were simulated in each case, and error was not identified,

5.3. Database Test

Automatic test was created for the database link and operation of the application, too.

DBTesting

 

package com.example.fpisti35.walkies;

import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.test.AndroidTestCase;

import com.example.fpisti35.walkies.db.DBContract.Student;
import com.example.fpisti35.walkies.db.DBHelper;

/**
* Created by Fpisti35 on 27/12/2015.
* based on Easy SQLite With Unit Testing by Hafiz
*/



public class DBTesting extends AndroidTestCase{

private static String mStudentName;
private static int mStudentAge ;
private static int mStudentRollNumber ;
private static long mStudentDBAssignId ;


public void testDropDB(){
assertTrue (mContext.deleteDatabase(DBHelper.DATABASE_NAME));
Utilities.Log("testDropDB Pass");
}

public void testCreateDB(){
DBHelper dbHelper = new DBHelper(mContext);
SQLiteDatabase db = dbHelper.getWritableDatabase();
assertTrue (db.isOpen());
db.close();
Utilities.Log("testCreateDB Pass");
}

public void testInsertData(){
DBHelper dbHelper = new DBHelper(mContext);
SQLiteDatabase db = dbHelper.getWritableDatabase();

mStudentName = "Micheal";
mStudentAge = 9;
mStudentRollNumber = 1001;

ContentValues contentValues = new ContentValues();
contentValues.put(Student.COLUMN_NAME, mStudentName);
contentValues.put(Student.COLUMN_AGE, mStudentAge);
contentValues.put(Student.COLUMN_ROLL_NO, mStudentRollNumber);

mStudentDBAssignId = db.insert(Student.TABLE_NAME, null, contentValues);
assertTrue (mStudentDBAssignId != -1);
Utilities.Log("testInsertData Pass - ID: "+ mStudentDBAssignId);
}


public void testIsDataCorrectInDB(){
DBHelper dbHelper = new DBHelper(mContext);
SQLiteDatabase db = dbHelper.getWritableDatabase();
Cursor cursor = db.query(Student.TABLE_NAME,null,null,null, null,null,null);
assertTrue (cursor.moveToFirst());

int idColumnIndex = cursor.getColumnIndex(Student._ID);
int dbId = cursor.getInt(idColumnIndex);

int nameColumnIndex = cursor.getColumnIndex(Student.COLUMN_NAME);
String dbName = cursor.getString(nameColumnIndex);

int ageColumnIndex = cursor.getColumnIndex(Student.COLUMN_AGE);
int dbAge = cursor.getInt(ageColumnIndex);

int rollNoColumnIndex = cursor.getColumnIndex(Student.COLUMN_ROLL_NO);
int dbRollNo = cursor.getInt(rollNoColumnIndex);

assertEquals (mStudentDBAssignId, dbId);
assertEquals (mStudentName, dbName);
assertEquals (mStudentAge, dbAge);
assertEquals (mStudentRollNumber, dbRollNo);

Utilities.Log("testIsDataCorrect Pass");
}
}
 

As the codes show, the software create a database, insert data and then it check the existence of data. This test was also run without any error.

DBTesting

6. Evaluation

At the beginning of the module, we started from scratch as we had not used Android Studio or Java language. We got an insight about the variations of application during the module and this project.

Although based on the description of the task, the application did not have to complete complicated tasks, it was getting more complex during the development. Finally, an application has been developed which is easy to use, function well and proved its stability and operability during tests.

As the development did not happen in real environment, regular customer meeting could not been realised. Therefore, it is not guaranteed that implementation has met expectations but it is an ideal starting point for a final version.

7. Summary

During development of the project, I discussed the basic features and principles of mobile applications. We gained knowledge about basic functions, expectation of design, storage methods and integration of outer applications. Acquisition of this knowledges has been proved by the application finished.


Hopefully, this knowledge will be able to be used in real life and for our thesis in similar topic.

 

8. References

1. Android Developers, Design Principles (2016). [ONLINE] Available at: http://developer.android.com/design/get-started/principles.html. [Accessed 04 January 2016].

2. Android Developers, Storage Options (2016). [ONLINE] Available at: http://developer.android.com/guide/topics/data/data-storage.html. [Accessed 03 January 2016].

3. Bagi, L. (2010). Android Pedometer. [ONLINE] Available at: https://github.com/bagilevi/android-pedometer [Accessed 30 November 2015].

4. Bergvall-Kåreborn, B, & Howcroft, D (2014). 'Persistent problems and practices in information systems development: a study of mobile applications development and distribution', Information Systems Journal, 24, 5, pp. 425-444, Business Source Elite, EBSCOhost, viewed 30 December 2015.

5. Charland, A, & Leroux, B (2011). 'Mobile Application Development: Web vs. Native', Communications Of The ACM, 54, 5, pp. 49-53, Business Source Elite, EBSCOhost, viewed 31 December 2015.

6. de Andrade, P, Albuquerque, A, Frota, O, Silveira, R, & da Silva, F (2015). 'Cross platform app: a comparative study', arXiv, EBSCOhost, viewed 1 January 2016.

7. GSMA The Mobile Economy (2015). [ONLINE] Available at: http://www.gsmamobileeconomy.com/GSMA_Global_Mobile_Economy_Report_2015.pdf . [Accessed 31 December 2015].

8. Facebook for developers (2015). Getting Started Android SDK, [ONLINE] Available at: https://developers.facebook.com/docs/android/getting-started [Accessed 02 December 2015].

9. Hafiz, W. H (2014) Easy SQLite With Unit Testing, [ONLINE] Available at: https://github.com/Hafiz-Waleed-Hussain/EasySQLiteWithUnitTesting [Accessed 30 December 2015].

10. IDC Research, Inc., Smartphone OS Market Share (2015). Retrieved from http://www.idc.com/prodserv/smartphone-os-market-share.jsp , viewed 11 November 2015

11. iOS Developer Library, Design Principles (2016). [ONLINE] Available at: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/Principles.html#//apple_ref/doc/uid/TP40006556-CH4-SW1 [Accessed 03 January 2016].

12. iOS Developer Library, File System Programming Guide (2016). [ONLINE] Available at: https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html . [Accessed 03 January 2016].

13. iOS Security Guide (2015). [ONLINE] Available at: https://www.apple.com/business/docs/iOS_Security_Guide.pdf. [Accessed 03 January 2016].

14. Jyothy, J. and Shinto, K. K (2013). ‘Mobile OS – Comparative Study’, Journal of Engineering, Compu ters & Applied Sciences (JEC&AS), ISSN No: 2319-5606 Volume 2, No.10, October 2013

15. Luterbach, K, & Hubbell, K (2015). 'Capitalizing on App Development Tools and Technologies', Techtrends: Linking Research & Practice To Improve Learning, 59, 4, pp. 62-70, Professional Development Collection, EBSCOhost, viewed 1 January 2016.

16. Pantel, I (2012). Android vs. iOS: UI/UX Differences - ELEKS Labs. 2016. Android vs. iOS: UI/UX Differences - ELEKS Labs. [ONLINE] Available at: http://elekslabs.com/2012/12/android-vs-ios-user-experience.html. [Accessed 04 January 2016].

17. Wingnity Team (2014). Android GPS, Location Addressing Using Location Manager Tutorial, [ONLINE] Available at: http://www.wingnity.com/blog/android-gps-location-address-using-location-manager/ [Accessed 28 November 2015].