Teach Me Maths Android Application Computer Science Essay

Published: Last Edited:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

The aim of this project is to develop a mobile application to support learning of multiplication/division among Primary school children.The application will be focused on Multiplication and Division. I hope to use research into Learning Styles and Cognitive Styles to design an interactive Application which will help improve children's numeracy skills and support the cognitive processes of children. Cognition describes an individual's typical or habitual mode of problem solving, thinking, perceiving and remembering (Cassidy, 2004). The application will target at 3rd and 4th class children and will be developed for the Android platform.

A scenario where this application could be useful would be on a car journey. Parents are driving a car with children in the backseat. Instead of the children being bored during the journey or playing some video games, the parents can give the kids their phones to use the app. This way the parents will be happy that their children are learning for the duration of the journey. The children will also benefit from this as they will be improving their numeracy skills

I also believe that this project could be useful in the school environment. Teachers will be able to give their students homework through the app and monitor student progress through from their scores.

1.2 Concept of the Application

The name of the Application will be 'Buzz-Bang'. It will use Cognitive methods combined with Gamification to provide an interactive educational experience to the user. The game should help develop the 'step-counting' technique for multiplication.

In the game, the user will be shown three numbers: A, B, and C. The user will have to perform two calculations in order to determine the correct answer. There are three possible answers for the user to choose from: 'Buzz', 'Bang', and Buzz-Bang'. If A is a multiple of C, the user should push the 'Buzz' button. If B is a multiple of C, the user should push the 'Bang' button. If both A and B are multiples of C, then the user should push the 'BuzzBang' button.

In the test section of the game, the users score will be calculated throughout the round and presented to them at the end of the round, along with their high score and their average score. No help will be available to the user in this section.

The game will also have a practice section which allows the user to play the game without having his/her score recorded. The user will have access to help in this section relating to the question they are on. If the user answers a question incorrectly then they will be shown the help section before attempting the question again.

The game will have different levels of difficulty. In the beginners level, the user will have to calculate multiples of 1, 2, 5 and 10. In the intermediate level, users will have calculate multiples of 1, 2, 3, 4, 5, 6 and 10. In the advanced level, users will have to calculate multiples of all numbers from 1-12. Users should be able to achieve high scores at one level before moving on to the next level.

Users will be able to keep track of their overall stats and progress in the user profile section of the application.

1.3 Technologies used in the project

In order to develop my Android application I will have to utilize a number of different technologies. An important part of my project was to understand and implement these technologies correctly.

All Android applications are developed in the Java programming language. XML files are used to define the structure of the User Interface. I will develop my application using the Eclipse IDE along with the ADT (Android development tools) plug-in. This plug-in extends the normal allows android projects to be created in the Eclipse environment.

Since my application will require users' data to be stored, the android device will have to communicate with a remote server, sending and receiving user data over the internet. This means that several more technologies will be used in the development of my application.

I will use a WAMP server to store the required data. WAMP(Windows, Apache, MySQL, PHP) provides an environment for developing projects using MySQL and PHP. For my application I will store user details in a MySQL database. Since Android devices cannot connect to MySQL databases directly, I will write PHP classes which connect to the database, retrieve information from the database, and update the database when required. The data will be transferred from the database to the Android device in JSON format. JSON is a format for storing and transferring text information.

In order to connect to the database my application will send a request to PHP class. The PHP class will carry out the required operation and return data to the application.

1.4 Methodology

I used the following methodology while carrying out research for the project. The first step was to identify the relevant reading resources. For this I searched Google scholar, which allows you to search for scholarly literature from many sources. The University of Limerick library and CAL (Computer aided Learning) also provided me with some useful articles.

Once I had identified the relevant material I began my literature review. For each article I wrote a brief introduction of the article, wrote a summary of the key findings from the article, and concluded how these findings could be useful for my FYP,

Since I had no experience developing for the android platform, I began a series of tutorials which gave me a good introduction to the development process. The tutorials were from the website 'http://thenewboston.org/' who give free educational tutorials on a wide range of topics. While these tutorials were useful, I also used other sources to develop my Android application development skills such as 'http://www.androidhive.info' and 'http://automateddeveloper.blogspot.ie/. The book 'Beginning Android' by Grant Allen was also a good source of material for me.

Once I felt comfortable with Android development, I focused on the design and implementation of my application. This will be discussed further in chapter three of this report.

1.5 Objectives of my FYP

There are a number of objectives that I wish to achieve in my final year project. I hope to gain an understanding of different learning styles and cognitive models that can affect a child's development. I also hope to research the different challenges that face children who are learning mathematics. I will use this research to design an application which supports these education techniques.

I hope to develop a better understanding of the Android development environment. Since Android development is centred on the Java programming language, I hope implement what I have learned about Java in university, in my FYP. I have no previous experience of Android development so this will be a excellent opportunity to learn a new skill which is becoming more and more important as smartphones grow more popular.

I will learn about relational database management system (RDBMS) techniques, and use technologies such as MySQL, WAMP, JSON and PHP to utilise RDBMS in my Application.

I will evaluate number of applications which are already on the market using relevant guidelines. By evaluating these applications I will be able to design a better application myself. I will take the positive features of the existing applications and try to implement some of them while avoiding the negative aspects of the applications.

I will carry out research into the benefits of gamificaiton of education. There is a lot of research going on in this at the moment. If I feel that gamifying the application will help with cognitive learning then I will include it in my application.

I hope to implement all of the findings of my research in the Android Application. The design should succeed in meeting the cognitive needs of children.

1.6 Overview of my report

This report contains details my Final Year Project. Chapter 1 gives a brief introduction to the Project outlining the Projects concept, Requirements, and Objectives.

Chapter 2 will contain details of the research carried out into Learning styles, Cognitive Learning, the difficulties learning Mathematics, Gamification, and Android development.

In Chapter 3, I will discuss the Design and implementation of my Application. In Chapter 4, I will evaluate the finished application. Finally in chapter 5, I will discuss possible future work which could be carried out on my project, as well as giving a summary of my achievements in the project.

Chapter 2

2.1 Introduction

In the following chapter I will discuss the key findings of my research. I identified several topics which were relevant to my project, and found numerous articles based on these. The main subjects I was interested in were learning Styles/cognition, mathematics, gamificaiton and Android development,

2.2 Learning Style/Cognition

Since my Android application will be aimed at supporting children's educational needs, I wanted to find out about different learning styles and how these can impact a child's progress in education.

Somebody's learning style is the way that he/she chooses to approach a learning situation. This has an impact on his/her performance while learning and also impacts the outcome of the learning. There are a number of important concepts in the field which need to be understood. A person's cognitive style is a person's natural style of problem solving, thinking, and remembering. A person's learning style describes how a person can apply their cognitive style to a learning situation. A person can adopt different learning strategies to deal with different types of tasks. Cognitive styles are seen as being more automatic and natural than learning styles. Learning preferences are defined as favouring one method of teaching over another (such as group work over independent-work).

There are two main theories about the cognitive processes involved in children's mathematical learning.

The First theory stresses the importance of the numerical procedures that children have to learn at the start of their mathematical career at school without referencing their understanding of quantities or relations. However there is evidence that shows children cannot use these procedures without fully understanding their connection with quantities. This shows that learning about numbers themselves is not sufficient for learning mathematics.

The second theory focuses on the importance of children's reasoning about quantities and relations for mathematical learning, and assigns numerical procedures to a secondary role.

I wanted to see how these concepts could be applied to children learning mathematics. Children's success in learning mathematics varies a great deal from child to child. We must consider what underlying skills determine how well children do in mathematics. For example, can a child take in and remember mathematical information well, calculate efficiently, and reason logically. Finding answers to these questions should allow better systems for teaching mathematics to be devised. Learning Mathematics in Primary school involves learning about numbers, quantities and relations, and about the connections and distinctions between these concepts. Quantities and numbers are not the same. A quantity can be represented by a number but we do not always need to measure a quantity to represent it by a number. Relations have a converse (greater than/less than/etc...). In order to learn Mathematics, children must be able to coordinate their understanding of quantities with their understanding of relations, and must also be able to distinguish between them. Children can only truly understand the meaning of numbers only when they understand, for example that all sets with the same number of objects are equivalent, and if two sets are equivalent they necessarily have the same number of objects. They also need to understand that you only change the number in a set if you add or subtract elements.

Studies(Nunes, Byrant, Sylva and Barnes(2009)) have shown that the relation between mathematical reasoning and mathematical achievement is evidence that children need to spend time learning what quantitative relations are and how to reason about them logically and enterprisingly. Children's ability to both calculate and to reason about mathematical relations when they were 7/8 years old played a key role in their mathematical achievement over the next 5 years, and that the contribution made by the children's ability to reason mathematically was far greater than the contribution made by the children's ability to calculate.

2.3 Step Counting

One method which is being used to teach multiplication is known a 'step-counting'. This is the favoured method of the 'Project-Maths' curriculum for teaching multiplication to children. From emails with 'Project-Maths' I learned that students going into secondary school are not as comfortable with step-counting as they should be.

In 'step counting' a multiplication sum is worked out by counting up in steps. For the sum (5*6), the answer is found by counting 6…12…18…24…30. 'Step-counting' is a good technique to use when teaching as, usually error in multiplication stems from mistakes made in written calculation. These mistakes are normally caused by following an incorrect or faulty procedure. Even if a student is following an incorrect method they will assume that the answer they get is correct. However if a student works through the sum with step-counting he is more likely to have got the correct answer. Using this technique will give children a deeper knowledge of multiplication, and an awareness of modifications that they could make to number in a calculation which would still give them the same result. They will understand that (3 + 1 + 1+1) is the same as (3*2). Children will also be able to work out more complex problems by splitting them up into smaller problems. Initially children should be able to derive multiples of 2, 5, and 10. Once they are comfortable with this they should be moved onto multiplication facts for 2, 3, 4, 5, and 6. After this stage they progress onto higher numbers.

2.4 Gamification

In recent years the potential of using Gaming in education has become a much discussed topic. Gamification is the incorporation of game elements into non-game settings. Gamification in education can help solve problems with student motivation and engagement. In education, it attempts to use the motivational power of games to improve student motivation and engagement.

Something about the typical learning environment fails to engage students. Video Games and virtual worlds excel at engagement. Lessons are not usually regarded as playful experiences. In order to understand the potential of Gamification, we need to consider how its techniques can be deployed in practice effectively. There are two major areas where gamificaiton can be useful:


Games guide players through a process and keep them engaged with potentially difficult tasks. 'One critical game design technique is to deliver concrete challenges that are perfectly tailored to the player's skill level, increasing the difficulty as the player's skill expands. Specific, moderately difficult, immediate goals are motivating for learners, and these are precisely the sort that games. In the best designed games, the reward for solving a problem is a harder problem. This supports motivation and engagement. These techniques can transform student perspectives on learning.


Games can provide positive emotional experiences such as optimism and pride. Games can also help players persist through negative experiences and turn negative experiences into positive. Games often involve failure and may require the player to fail multiple times, learning something each time. Games allow players to keep trying until they succeed, and to risk very little by doing so. With traditional learning, the stakes of failure feel much higher and cause students anxiety. Games offer them a feeling of anticipation when given the chance to fail/overcome failure. Games portray failure as a necessary part of learning, and create an environment where effort is rewarded.

Risks and Benefits

Gamification can motivate students and get them to apply themselves fully in learning environments. It can show students that education can be a more informal, enjoyable experience. Since Games have clear objectives and give instant feedback to the player, players can change how they play in order to improve and reach the objectives. This also applies to students who will improve their work when given constructive feedback.

2.5 Introduction to Android

Android is an operating system for mobile phones based on the Linux platform. It delivers a complete set of software for mobile devices, an operating system, middleware, and key mobile applications. It was primarily designed for touchscreen mobile devices such as smartphones and tablets. Android provides an open platform to developers for creating their own applications for use by various mobile devices.

While Android is currently developed by Google, it was not originally created by them. Android Inc. was a start-up company who were working on new software for smartphones. Google bought Android. Inc in 2005 and were ready to release their first android device in late 2008.

The different components of Android are designed as a stack. Android 'Applications' form the top layer of the stack. The Linux kernel forms the bottom layer. All applications are written in the Java programming language. The application architecture is designed to simplify the reuse of components. The capabilities of any application can be published and then be made use of by other applications. Android includes a set of core libraries that provides most of the functionality available in the core libraries of the Java programming language. Applications can call upon any of its phones core functionality such as making calls, sending text messages, or using the camera. These provide the functionality needed to build quality mobile applications. Android relies on Linux for core system services such as security, memory management, and process management.

The recommended Android development environment is the Eclipse IDE. An ADT(Android development Tools) plug-in is available for Eclipse. This extends the capabilities of Eclipse to allow new android projects be created. It can create applications UI's, debug applications using the Android SDK tools, as well as export .apk files allowing distribution of applications. The Android SDK(Software development kit) provides the API libraries and tools necessary for Android development.

Android allows developers to combine information from the web with data on the phone to provide a more relevant, innovative user experience. Since Android is open source, it can be extended to incorporate new technologies as they emerge. As developers continue to build innovative mobile applications, the Android platform will continue to evolve.

By the end of 2011, more than 200 million Android devices had been activated around the world, with an estimated 555,000 devices being activated each day. These figures show that Android is quickly catching up with apple's ios platform. However most reports show that Android is the dominant smartphone. Data from the third quarter of 2012 showed that Android has 75% of market share of smartphones.

2.6 Designing, Developing, and Using Secure Mobile Applications

Developing mobile applications and their corresponding mobile web Services is quite different from developing traditional Web-services and desktop-oriented applications, due to the limited available resources (CPU, memory, battery, etc), and communications aspect (connection availability, security, etc.). Before mobile applications can be adopted at a large scale and for heavy transactions, there are plenty of technical aspects that have to be addressed. Transaction-related data should always be accessible to mobile applications. This accessibility is mainly affected by three factors:

1. Availability of connections between mobile applications and mobile Web services,

2. Available bandwidth, and

3. Network latency

If there are no connections, data should be stored locally. As soon as a connection is available, both offline transactions and data must be updated and committed. Optimizing the transfer of data means deciding how much data should be located on the device and how much data should travel back and forward between the applications and the mobile web service The main problem that rises is how to decide which data to keep remote and which to bring to the mobile device. Decision criteria include available resources, cost of storage, cost of communication, significance and sensitivity of data, security and cost and benefits of compression.

Because of this, developers need to consider a number of issues when developing an application.

How to present the User Interface?

How to support offline operations?

How to deal with limited bandwidth?

How to hide high and unpredictable latency?

How to ensure security?

How to ensure browser's compatibility?

How to decide on local or remote computation?

How to adapt mobile Web services?

To solve these issues the following framework could be applied. The framework involves two main participants: the mobile client environment, and the backend server/mobile Web service.

The backend server consists of eight components:

Enterprise Web Applications: integrate functionality from remote Servers

Business Logic: represents the core of the mobile application that exposes functionalities.

Content Management System: A System to manage different contents and data. This includes importing creating updating and removing content to/from the mobile application.

Workflow and profile management: manages the flow of data between the mobile application and the backend server and adapts the mobile application features and interface to different user's profiles.

User management: allows management of different types of users with different levels of access.

Database: used to store data about objects and content

Web Services: web components that can be deployed on backend server and can n be invoked by the mobile application.

Document Repository: is used to store different types of documents.

The mobile client environment consists of six components:

Business logic: it may be necessary to use some of the business logic on th application itself(e.g. if it is offline).

Secure Layer Interfaces: handles secure user authentication. Provides different interfaces for different user's profiles.

Mobile Application API's: a set of libraries that implement a set of utilities that that may be required by the mobile application.

User Interface: This is the GUI components that mobile clients use to access different services.

Data Storage: the place where persistent data is stored.

Browser: used to display web content

2.7 Android Security:

Since my application will contain some personal information about children through their profiles, security is an important issue to consider. Parents and teachers will not feel comfortable allowing children to use an application which does not keep students information safe.

Android uses a simple permission label assignment model to restrict access to resources and models. Several refinements have been added to the System as it evolved.

In the Android application framework, developers must design applications in terms of components. The frame-work doesn't have a main() function or a single point of entry. Android defines four component types: Activity components, Service components, Content provider components, and Broadcast receiver components.

Activity components define an applications user interface. Usually, one activity is defined per "screen". Activities start each other, and can pass in/return value. For example, Facebook allows the use of the camera app to upload photos. Service components perform background processing. If an activity needs to perform an application after the user interface disappears, it can start a service specifically designed for that action. Content provider components store and share data using a relational database interface. Each content provider has an associated "authority" describing the content it contains. Broadcast receiver components act as mailboxes for messages from other applications. Application code often broadcast messages to an implicit destination. Broadcast receivers subscribe to such destinations to receive the messages sent to it. Application code can also address a broadcast receiver explicitly by including the namespace assigned to its containing application.

The primary mechanism for component interaction is an 'intent'. An 'intent' is a message object containing a destination component address and data. The Android API defines methods that accepts intents and uses this information to start activities, services, and broadcast messages. (startActivity(Intent), sendBroadCast(Intent)). The invocation of these methods tells the Android framework to begin executing code in the target application. This process is known as an Action.(An intent object defines an "intent" to perform an "action").

Android protects applications and data through a combination of two enforcement mechanisms, one at System level and the other at the inter-component communication (ICC) level. ICC mediation builds on the guarantees provided by the underlying Linux System, and is the main focus of this article. Each application runs a unique user identity which lets android limit the potential damage of programming flaws. This means that to each component is restricted by assigning it an access permission label. Developers assign applications collection of permission labels. When a component initiates ICC, a reference monitor looks at the permission labels assigned to its containing application and, if the target components access permission label is in that collection, allows ICC establishment to proceed. If the label is not in that collection, then establishment is denied. The developer assigns permission labels via the XML manifest file that accompanies every application. This defines the applications security policy. Assigning permission labels to an application specifies its protection domain whereas assigning permissions to the components in an application specifies an access policy to protect its resources. All permission labels are set at install time.

Several Refinements have been made to the basic Android security model as the system evolved

Applications often contain components that another application should never access. Instead of defining an access permission, the developer could make a component private. By making a component private, the developer doesn't have to worry which permission label to assign it or how another application might acquire that label.

The developer of an activity can decide not to assign an access permission to it. If a public component doesn't explicitly have an access permission assigned to it, any application can access it. While this supports the reuse of functionality it can lead to poor security practice.

Unprotected intent broadcasts can unintentionally leak information to explicitly listening attackers. The Android API for broadcasting Intents optionally allows the developer to specify a permission label to restrict access to the intent object. Some system resources (camera, microphone, etc) are accessed through the direct API access rather than through components. Android protects these APIs with additional permission label checks. An application must declare a corresponding permission label in its manifest file to use them (e.g. declare the INTERNET permission label).

There are four protection levels for permission labels in Android. "Normal" permissions are granted to any application that requests them in its manifest. "Dangerous" permissions are granted only after user confirmation. "Signature" permissions are granted only to applications signed by the same developer key as the package defining the permission. "Signature or System" act like 'signature, and exist for compatibility with the older Android system.


There are a number of guidelines that should be followed when designing a user interface for a mobile application:

Enable Frequent Users to Use Shortcuts

Since time is often a key factor for the user, reducing the number of operations required to perform regular tasks is an important part of the design process. This will increase the speed of interaction between the user and the system.

Offer Informative Feedback.

For every operation by the user, there should be some system feedback. The feedback should be both informative and understandable.

Support Internal Locus of Control

It is important that the user feels like they are in control of the system. Mobile Applications should be designed so that they respond to the users' actions rather than controlling them.


Users may need to switch between mobile devices and it is important that consistency is maintained between all devices, across multiple platforms.

Reversal of Actions

Reversing an action and returning to a previous state can be a challenging process for a mobile application to achieve due to the limited memory and computing power available.

Error Prevention and Simple Error Handling

Error prevention need be aware of the physical attributes of mobile devices. Many of these devices have very small buttons which are in close proximity to each other. This

can cause problems for users. Error handling is very important given the pace of events on mobile devices.

Reduce short-term memory load

Often while using a mobile device, the user will not be 100% focused on the application. Interfaces should be designed so that the user does not need to memorize anything in order to complete the task.

Design for multiple and dynamic contexts

There are often other distractions vying for a user's attention when using mobile applications. Environmental conditions or the presence of other people can alter how a user interacts with the device. It is important to allow for different operation to be implemented in various contexts. By implementing context awareness and self-adapting functionalities, the usability of the application will be increased.

Design for Limited and Split Attention

Since a mobile application may not be the focal point of the user's current activities, it is important to design an interface which requires as little attention as possible to use.

Design for speed and recovery

Time constraints need to be taken into account when designing a mobile application. Users may need to quickly access other applications. When this happens, the users work will need to be saved quickly and securely for later use.

Allow for personalization

Different users may have different preferences and skill levels, when it comes to using an application. It is important to allow for variation and personalization of the application for things such as backgrounds or font sizes.

Design for Enjoyment

Aesthetics is also an important aspect in the design of a user interface. Colour is important for visual interfaces and can help invoke a positive response from the user,

2.9 Evaluation of existing apps

Before I began to design my Application I wanted to evaluate some of the educational apps which were already on the Google Play store. I felt that this would give me some good ideas for designing my own application. I evaluated the applications based on the guidelines discussed in section 2.7. This was a beneficial exercise as it showed me some features which I could implement in my own design and also showed me some features which should be avoided. It also gave me some good ideas relating to the layout and structure of my application. I had to consider how I would design my application so that it would be an improvement on existing applications.

The first application I looked at was called 'Multiplication Tutor' which aims to help 'Learn and Practice Multiplication Tables'. The first thing I noticed was that the background of the main menu seemed dark and cluttered. It is not obvious to the user which option to take to begin using the application. Another drawback of the application is that you have to push a 'next' button to get to the next question. This should be done automatically when a correct answer is given. There is no constructive feedback given. The user is only told if he/she is correct or incorrect.

The next application I looked at was 'Kids Numbers and Math' which is described as 'A fun way for kids to learn numbers and build basic math skills'. This application was aimed at pre-school children to learn basic maths skills. Any child using this application needs to be registered by a parent/guardian. This allows the parent/guardian to track the progress of the child. Feedback about each child is given in the 'parents centre'. Users can also play as a guest. This application has a bright colourful background which is easy to focus on.

The final application I am evaluating is 'Learn & Fun for Kids' which is described as 'Possibly the best and most complete educational game for Android'. This application doesn't just focus on Maths but teaches the alphabet, shapes and colour as well. On the home screen I found that the buttons did not stand out and it was not clear what option to take. A positive feature of this application is that it allowed for personalization of backgrounds and background music. The application also keeps track of the high scores achieved by the user.

Screenshots of evaluated Apps

Multiplication Tutor



Kids Numbers and Math



Learn & Fun for Kids



Chapter 3-Design and Implementation

Once I had completed my research and decided on a concept my application, I began to think about its design. The Android developer guide gives some guidelines on mobile application design.

3.1 Screen Navigation Design

According to the official Android developer guide, 'One of the very first steps to designing and developing an Android application is to determine what users are able to see and do with the app'. With this in mind I started to plan out the high level screen hierarchy of my application.

I began by deciding on the set of screens which would be needed to allow users to view and interact with the application correctly. The set of screens I decided on were:

Home Page Screen

This page will contain the applications home menu.

Play Screen

This is the screen the user will see when playing a game.

Practice screen

This is screen that the user will see when practicing the game

Help Screen

If a user requires help in a practice game, this screen will appear.

Instructions Screen

This Screen will show the user how the game works

Log-in Screen

This screen will allow the user to log-in to his/her account

Set-up Account Screen

This screen will allow a user to create a user account

User Menu Screen

This Menu allows the user to play/practice while logged in, as well as the option to view their statistics to date. This screen also allows the user to log out.

User Statistics screen

This screen will show the user statistics from their previous games

Score Screen

This screen tells the user what score they got in their precious game and allows them to return to the User Menu Screen

Once I had decided on the screens, I defined the relationships between them in a screen map. This allowed me to see how the different components of the application would interact with each other.


The next part of the design process was wireframing. This involved sketching the layout of each screen by hand. At this early point in the process, precision was not important. However, drawing these rough sketches gave me a better understanding of how the users would interact with the application as well as making me consider the practicality of my original screen map design.

Home Menu Account Screen Log-in Screen

DSC_0665.JPG DSC_0666.JPG DSC_0667.JPG

Set-up Account User Menu Play Screen

DSC_0668.JPG DSC_0669.JPG DSC_0670.JPG

Practice Screen Help Screen Instructions Screen

DSC_0671.JPG DSC_0673 (1).JPG DSC_0674.JPG

Score Screen Statistics Screen

DSC_0674.JPG DSC_0675.JPG

Once I had these screens designed, I was able to start writing code. While the screen design was not final, it gave a good basis to begin implementation, and allowed for refinement at a later stage.

3.2 Database design

A key requirement for my Android application was the ability to keep track of a users details and scores. This meant that I needed a database storing this information, which an android device could connect to, retrieve data from, and update user information on. Since Android cannot connect directly to a database server, I had to create a PHP API which carries out operations on the database, and returns a response to the Android application. All data will be transferred between the databases to the Android device in JSON format. JSON is a format for storing and transferring text information.

The first step in designing my database was to set up a web server which would host the required tables, as well as the PHP API. For my project I felt that a WAMP server would work well. WAMP stands for Windows, Apache, MySQL and PHP. It provides an environment for developing applications with PHP and MySQL on a Apache web server.

I created a simple database with only one table to store information from the application. The 'user_details' table contained columns representing the users' username, password, the number of games played, the users' average score, and the users' high score. I created the 'user_details' table using a MySQL 'Create' query.

Once my database was created, I created two PHP classes which would be used to connect to the database. The class 'db_config.php' contained the variable required to open a connection with the database. The class 'db_connect.php' imported the variables from 'db_config.php' and used these variables to open a connection with the database.



define('DB_USER', "root"); // db user

define('DB_PASSWORD', "********"); // db password

define('DB_DATABASE', "fyp"); // database name

define('DB_SERVER', "localhost"); // db server




class DB_CONNECT {

// constructor

function __construct() {

// connecting to database



// destructor

function __destruct() {

// closing db connection




* Function to connect with database


function connect() {

// import database connection variables

require_once __DIR__ . '/db_config.php';

// Connecting to mysql database

$con = mysql_connect(DB_SERVER, DB_USER, DB_PASSWORD) or die(mysql_error());

// Selecing database

$db = mysql_select_db(DB_DATABASE) or die(mysql_error()) or die(mysql_error());

// returing connection cursor

return $con;



* Function to close db connection


function close() {

// closing db connection





Having established a connection to the database I needed to create PHP classes which would perform different operation on the table in my database. The first operation I needed to perform was to create new users. The 'create_user.php' class connects to the database using 'db_connect.php', before inserting a new row into the 'user_details' table. When there is a problem inserting a row into the table the class returns an error specifying the problem.


There were still a number of operations which I would need carried out on my database. To meet the requirements of the game, the 'user_details' table would need to be updated regularly so that the users' statistics will be updated. I solved this issue by adding more classes to the PHP API. My 'get_user_details.php' class is used to get the information required in the games statistics screen. 'update_user.php' is used to update a row relating to a particular user, and 'get_highscore.php' is used to get a particular high score




3.3 Game Development

There were a number of different areas to for me to consider while developing this game. I had to develop the core functionality of the game, such as generating questions, calculating the correct answer, keeping track of scores, providing help in the practice section of the game, and allowing for different levels of difficulty in the game. I had to ensure that the screen layout and UI components were consistent with the original design of the game as shown in section 3.1, without compromising the core functionality. I also had to integrate the remote web server, and the PHP API (discussed in section 3.2) with my application.

3.3.1 Generating Maths Questions.

In order for the application to meet its requirements I had to develop a solution which generated random questions for various levels of difficulty. To achieve this I implemented the state design pattern. The state design pattern allows objects to change their behaviour depending on internal state. I utilised this pattern as it would allow the application to generate different questions depending on the difficulty level chosen. I created a 'PlayLevel.java' class which contained a number of different internal states, each representing a different level of difficulty. My 'PlayState.java' class defined an common interface for the various levels, encapsulating the behaviour of the various levels. When 'PlayLevel.java' changed state, it had a different level associated with it, causing a different set of questions to be generated.



PlayLevel.java(sample section of the class)

Another challenge that I faced was keeping track of what question the user is on and keeping track of their current score. Keeping track of the question was of particular importance in the practice section of the game. If a user got a question wrong, and required help from the help section, it was important that they attempted to answer the same question again afterwards. If the game generated a new question in the practice section after offering help to the user, then the user would not improve their learning skills. To solve this issue I utilised Androids Application class. The Application class allows an object to maintain a global application state. This meant that I could keep track of game details, even when the application was moving between different activities. I created a 'BuzzBangApp.java' class which extended the Android Application class. 'BuzzBangApp.java' contains a 'Game' object, which keeps track of the current Question and current score. Every time the user starts a new game, a new 'BuzzBangApp' object is created.


Game.java(Section of code from class

3.2.2 Connecting application to the Database

One of the main requirements of the game is that it can keep track of a user's progress and scores. As seen in section 3.2, Android applications cannot connect directly to a database server, and to solve this error I need to create a PHP API which would pass data between the Android application and the database server. In section 3.2, I gave an example of the create_user.php class which can add a new row to the user_details table. In order to link the application to the database I needed to create a 'NewUserActivity.java' class which would connect to the database through 'create_user.php'. The NewUserActivity.java class will receive user data, and pass this data onto the create_user.php class. NewUserActivity.java will then receive a response stating if the new user was successfully created or not.

NewUserActivity.java3.3.3 Creating Screen Layouts

According to the official Android developer guide, "A Layout defines the visual structure for a user interface" ( http://developer.android.com/guide/topics/ui/declaring-layout.html). Android allowed me design my screens using simple xml classes. It is relatively straightforward to instantiate these screen layouts at runtime and integrate the back-end code with the user interface. I demonstrate my implementation of xml screen layout in the section 3.4 of this report where screenshots of my project are displayed. Each screen that I created was done using XML classes.

3.4 Screenshots of my application.

Home Menu Account Screen Log-in Screen

DSC_0665.JPG DSC_0666.JPG DSC_0667.JPG

Play Screen Practice Screen Help Screen

DSC_0671.JPG DSC_0673 (1).JPG DSC_0674.JPG

New User Screen


Chapter 4 Evaluation

4.1 Evaluation of my application

In section 2.7 of this report, I outlined some use User Interface guidelines that all mobile applications should follow. These were:

Enable Frequent Users to Use Shortcuts

Offer Informative Feedback.

Support Internal Locus of Control


Reversal of Actions

Error Prevention and Simple Error Handling

Reduce short-term memory load

Design for multiple and dynamic contexts

Design for Limited and Split Attention

Design for speed and recovery

Allow for personalization

Design for Enjoyment

In this section I will evaluate my own application based on these guidelines.

Enable Frequent Users to Use Shortcuts:

The application is quite straight forward to navigate through, and the number of operations required by the user to start a game is minimal. There is currently no option to quit in the middle of a game and return to the menu. This is a shortcut which should be added to improve user experience.

Offer Informative Feedback:

The application gives the user feedback at the end of every round as the user is shown his/her scores immediately. The user receives feedback in the practice section. If they get a question wrong they will be shown the help screen straight away. The statistics screen also gives the user feedback on their previous scores.

Support Internal Locus of Control:

Users will feel as though they are in charge of the application. The application will only respond to the users actions, giving them full control.


Consistency across platforms is not supported in this application as it has only been developed for the Android platform.

Reversal of Actions:

Reversal of action is not provided in the test section of the game. This is to stop users from changing their answers if they get a question wrong. Reversal of action is provided in the practice section. After being shown the help screen, Users are brought back to the previous question.

Error Prevention and Simple Error Handling:

The application will check if the Android device is connected to the internet/ has 3G coverage. If the device is not connected then the user will not be able to log in or create a new user account. The user will instead be brought back to the main menu.

Reduce short term memory load:

The user does not have to memorise much about the application as long as he/she understands how the game works.

Design for multiple and dynamic contexts:

Even if users get distracted while playing a game, they will be able to return to the question they were on.

Design for limited and split attention:

The applications interface does require a lot of attention while playing, as there are a number of different numbers and answers that need to be considered. The interface could be improved, to make it a more intuitive game.

Design for speed and recovery:

At the moment, the users details are only updated after every round. If the users game is interrupted suddenly, the users progress will not have been saved.

Allow for Personalisation:

The application does not have different preferences available for different users to choose from. It does allow for users of different skill levels.

Design for enjoyment:

While the colour scheme of the game screen is bright, overall the application needs more work on the aesthetics of the screens.

4.2 Evaluation of the FYP process

Overall I found the Final Year Project quite challenging. From the amount of research that was involved, deciding which technologies to use and learning how to use them, the design and implementation of the software, and documenting my work in a report, the project was a huge workload. However, looking back on the whole process, there are some things that I feel I could have managed better, which would resulted in an improved performance and end product.

I spent the first 2/3 months doing research on different aspects of education, learning styles and mathematics. I also completed some basic Android development online tutorials in this time. My primary focus though was on education based research. While this was very important, I should have put more time into Android development. The tutorials I completed gave me a good foundation in Android development, but they did not prepare me for some of the more technical issues I faced during development of the Application (server-side issues). If I had come across these issues earlier in the FYP process, I would have been better equipped when I began development of the application.

I felt that I had a good relationship with my FYP supervisor. After any of our meetings I always knew what parts of the project needed to be improved, and what I should focus my time on. On reflection I should have kept him informed of any progress I was making more often than I did.

The FYP process was successful in getting me to work throughout the year. Having various deadlines for presentations, interim reports, etc…, helped me to focus and start work earlier than I would have otherwise done.

Chapter 5 Achievements and conclusion

5.1 Summary of achievements

I feel like I achieved a great deal by working on this project. It was by far the largest, most difficult project I have attempted to complete. I developed a range of skills during the course of the project which had not been covered in my Computer Systems course.

My research skills improved a lot, and I learned the importance of basing design decisions on established findings. Having had no interest in the topic before the FYP, I found the research into various educational topics quite interesting. I think that the area of ICT in education is going to grow and grow in the coming years.

I developed my programming skills during the implementation of my application. Even though I had no previous experience of Android development, I thought that the skills that I had developed in my course made the switch to Android development much easier to do.

I learned several new technical skills while working on my FYP, which will benefit me in the future. The experience I gained from setting up a database server, then connecting it to an Android device using the PHP API that I created was excellent.

A major achievement from the FYP was having a working version of my application to show to people on demo day. Some of the feedback I got during the demo day was really nice to hear

5.2 Future Work

There are a number of areas that I believe could improve the application. I intend to implement the following changes over the summer and put the application up on the Google Play store.

Add an instructions section to the App that explains how the game works

Improve the help screen of the practice section so that it emphasises step-counting techniques rather than showing the times table.

Add a classroom feature so that teachers could monitor their students' progress

Fix any remaining problems regarding updating the database.

Design a more intuitive game screen so that the game feels nicer to play

Design a suitable version of the application for tablets.