0% found this document useful (0 votes)
218 views

Anuna Confidence Nneoma-Design and Implementation of A Quiz Application For Android Device

This document provides an introduction and background on mobile application development. It discusses how mobile platforms are improving and the unique features of developing software for these platforms, including constraints like limited resources. It also describes how agile development methods are well-suited for mobile applications given characteristics like small teams and short development cycles. Finally, it introduces the problem of a lack of educational quiz applications for Android and the goals of creating one to help students learn computer science topics in a fun, interactive mobile format.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
218 views

Anuna Confidence Nneoma-Design and Implementation of A Quiz Application For Android Device

This document provides an introduction and background on mobile application development. It discusses how mobile platforms are improving and the unique features of developing software for these platforms, including constraints like limited resources. It also describes how agile development methods are well-suited for mobile applications given characteristics like small teams and short development cycles. Finally, it introduces the problem of a lack of educational quiz applications for Android and the goals of creating one to help students learn computer science topics in a fun, interactive mobile format.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 76

CHAPTER 1

INTRODUCTION

1.1 BACKGROUND
The mobile applications market is currently undergoing rapid expansion, as
mobile platforms continue to improve in performance, and as the users’ need
for a wide variety of mobile applications increases. The latest mobile platforms
allow for extensive utilization of network resources, and thus offer a strong
alternative to workstations and associated software. Software development for
mobile platforms comes with unique features and constraints that apply to most
of the lifecycle stages. The development environment and the technologies that
support the software are different compared to “traditional” settings. The most
important distinguishing characteristics are identified in (Abrahamsson, et al.,
2004). Environment particularities include: a high level of competitiveness;
necessarily short time-to-delivery; and added difficulty in identifying
stakeholders and their requirements. Development teams must face the
challenge of a dynamic environment, with frequent modifications in customer
needs and expectations. (Abrahamsson, 2007) Technological constraints apply
to mobile platforms in the form of limited physical resources and rapidly
changing specifications. There is also a great variety of devices, each with
particular hardware characteristics, firmware and operating systems. Another
view of the constraints associated with mobile applications is presented in
(Hayes, 2003). The author mentions two types of constraints, evolving and
inherent. Evolving constraints, such as bandwidth, coverage and security,
currently apply to the mobile technology, but are likely to be addressed and
possibly resolved in the near future. On the other hand, inherent constraints
such as limited screen real estate, reduced data entry capability (due to a limited
keypad for example), memory capacity, processing power and limited power
reserve, are permanent, at least relative to desktop environments. Various
approaches must be used in order to lower the impact of inherent constraints.

Due to significant differences in the environment and in platform


specifications, mobile application development requires a suitable
development methodology. By taking into account the main features of a
mobile application development scenario, a matching development paradigm
can be identified. These features are presented in (Abrahamsson, 2005): the
software is released in an uncertain and dynamic environment with high levels

1
of competition. Teams that develop mobile applications are usually small to
medium-sized, co-located, and generally use object-oriented tools and
practices. The applications themselves are small-sized, are not safety-critical,
and do not have to satisfy interoperability or reliability constraints. They are
delivered in rapid releases in order to meet market demands, and are targeted
at a large number of end-users. The author suggests agile methods as a suitable
approach to development, by comparing the above features to agile “home
ground” characteristics: small-scale, application-level software, developed in
a highly dynamic environment by a small to medium-sized team using object-
oriented approaches, in relatively short development cycles.

SOFTWARE
Software refers to one or more computer programs and data held in the storage
of the computer for some purposes. In other words software is a set of
programs, procedures, algorithms and its documentation. Program software
performs the function of the program it implements, either by directly
providing instructions to the computer hardware or by serving as input to
another piece of software. The term was coined to contrast the old term
hardware (meaning physical devices).

Software performs the following functions:


· Interfaces between the operator, peripheral components, and the control
computer's processor
· Regulates the flow of information among the components and the central
processing unit
· Translates commands from the operator into specific hardware instructions
· Allocates hardware resources for specific tasks
· Indexes and cross-references
· Produces workflow scripts for routing, document flow, and processing
· Provides administration, statistics, and reports

CLASSES OF SOFTWARES
Practical computer systems divide software systems into three major classes
system software, programming software and application software, although the
distinction is arbitrary, and often blurred.

2
SYSTEM SOFTWARE
System software provides the basic functions for computer usage and helps run
the computer hardware and system. It includes a combination of the following:
· Device drivers
· Operating systems
· Servers
· Utilities
· Window systems
System software is responsible for managing a variety of independent
hardware components, so that they can work together harmoniously. Its
purpose is to unburden the application software programmer from the often
complex details of the particular computer being used, including such
accessories as communications devices, printers, device readers, displays and
keyboards, and also to partition the computer's resources such as memory and
processor time in a safe and stable manner.

PROGRAMMING SOFTWARE
Programming software usually provides tools to assist a programmer in writing
computer programs, and software using different programming languages in a
more convenient way.
The tools include:
· Compilers
· Debuggers
· Interpreters
· Linkers
· Text editors

An Integrated development environment (IDE) is a single application that


attempts to manage all these functions.

APPLICATION SOFTWARE
Application software is developed to aid in any task that benefits from
computation. It is a broad category, and encompasses software of many kinds,
including the internet browser being used to display this page. This category
includes:

· Business software

3
· Databases
· Decision making software
· Educational software
· Image editing
· Industrial automation
· Mathematical software
· Medical software
· Molecular modelling software
· Quantum chemistry and solid state physics software
· Simulation software
· Spreadsheets
· Telecommunications (i.e., the Internet and everything that flows on it)
· Video games
· Word processing

ANDROID APPLICATION
Android app is a mobile software application developed for use on devices
powered by Google's Android platform. An Android application can be written
in several different programming languages such as, Java, C or C++.
Application developers can easily tap into the huge stack of system services,
tools and libraries to use in their application if required.

1.2 STATEMENT OF THE PROBLEM


It is essentially required to assist students for the learning and preparation Ict
related tests or examinations. However, there are few of such application in
android-based platform, which can provide mobile users with such tests in a
user friendly and interactive way. This is what I tried to address in the project
design and implementation of a mobile quiz application for android device
(using xml and java).

1.3 MOTIVATION
As Android is rapidly getting famous day by day and the number of its users
are increasing with every blink of eye, because it is easy to access the necessary
android based applications on smart phones and tablets in your hands.
Therefore, I found this idea interesting, easy and time efficient to facilitate the

4
users in this way without any difficulty. There are many online quiz
applications available on internet, but most of them are only for entertainment,
fun and can only be used with internet connection. Moreover, if one is going
to appear in any test or interview, then it is difficult and time consuming for
them to read the full books or articles related to specific fields for the
preparation or revising their knowledge. But the most attractive feature of this
app is that it will take learning and fun side by side. The application provides
users the facility to revise their knowledge or to learn something advantageous
at one place without wasting their time.

1.4 PROJECT AIM


The aim of this project is to study and understand the principles of application
development and to find an effective way to create an offline mobile quiz
application with 25 computer science questions and multiple choice options to
make learning fun and facilitate the users to be able to take short quizzes using
portable devices such as smart phones and tablets.

1.5 PROJECT OBJECTIVES


In order to achieve my aim, several objectives have to be achieved first. These
objectives are:
 Investigate the differing mobile development strategies and their
implications.

 Study of design features, principles and design patterns that a mobile


application should follow.

 Create a touch-friendly user interface, while retaining the value and


functionality of the application and providing an engaging mobile
experience that could be applied to other applications

 Investigation of tools that will be used to design and develop a mobile


application in the Android operating system.

 Create a Quiz Application to help users increase their general knowledge


about Computer Science and IT field, with an easy access to the app
directly on their Android phones.

5
1.6 SIGNIFICANCE OF THE STUDY
An android quiz application is going to play a fundamental role in helping
students and learners to prepare themselves for different examinations directly
through smart phones and tablets in hands. One of the major aim of this project
is to facilitate students in learning, gaining and improving their knowledge
skills. At the meantime, the app provides users fun so that the users can prepare
for interviews, entrance tests or any other corresponding purposes in a fresh
mood and can’t get bored or frustrated due to dullness of app. The application
is designed to facilitate users to be able to take short quizzes using android
devices such as smart phones and tablets.

1.7 DEFINITION OF TERMS


Quiz: A quiz is a form of game or mind sport, in which the players (as
individuals or in teams) attempt to answer questions correctly. It is a game to
test your knowledge about a certain subject.

ICT: Stands for information and communication technology. It is defined as


the infrastructure and components that enable modern computing.

Offline: Operating independently or disconnected from an associated


computer.

Java: Java is general-purpose, structured, generic, class-based computer


programming language

App: App is short for application

Xml: Xml is an extensible markup language for documents containing


structured information

Activity: An activity is a user interface that allows the user to interact with the
screen, to perform actions.

OS: OS stand for Operating system. An operating system is a system software


that manages computer hardware and software resources and provides
common services for computer programs.

6
IDE: integrated Development Environment (IDE) is a software application that
provides comprehensive facilities to computer programmers for software
development.

1.8 ORGANIZATION OF THE WORK


The remaining chapters of the project are organized as follows:
Chapter 1: contains the introduction, background of the study, statement of
problem , motivation, aims and objective, definition of terms.

Chapter 2: deals with the review of related literature.

Chapter 3: contains the research methodology.

Chapter 4: deals with the design and implementation of the project by stating
the specification required.

Chapter 5: contains the conclusion and summary.

7
CHAPTER 2
LITERATURE REVIEW

2.1 ANDROID INFORMATION AND BACKGROUND


Android is the first open source mobile application platform that has the
potential to make significant inroads in many markets.” (Ableson et al 2009).
Android is a software platform, and operating system for mobile devices.
Android was based on the Linux kernel and was developed by Google/ the
Open Handset Alliance. The Open Handset Alliance is comprised of various
corporations and companies. Members include, Google, HTC, LG, Samsung,
T-Mobile, Vodafone, Nvida, Dell, Intel, Ebay, Garmin, Accenture and much
more. A mix of mobile operators, handset manufactures, semi-conductor
companies, software companies, and commercialization companies. (Feinbube
2011, Open Handset Alliance 2012).

Google wanted to enter the mobile phone market mostly to sell more ads in
this new area. They acquired in July 2005 Android Inc., appointing Andy
Rubin as their Director of Mobile Platforms group. Google then entered the
mobile market, not as a new handset manufacturer but instead by introducing
a new Operating System(OS), called “Android” on November 5th, 2007.
Google wanted the OS to run on any device, whether they were HTC, Samsung
or Motorola. With this vision and the vision of having Android based devices
being able to do all a pc could do, they launched the Open Handset Alliance,
to help make it possible.(Gadhavi and Shah 2010).

2.2 ANDROID OPERATING SYSTEM


Android is a comprehensive open source platform designed for mobile devices.
It is championed by Google and owned by Open Handset Alliance. The goal
of the alliance is to accelerate innovation in mobile computing and offer
consumers a richer, less expensive, and better mobile experience. Android is
the vehicle to do so. Android is a Linux-based operating system mainly used
for running mobile devices such as smart phones and tablet computers. Its
usability is not limited to mobile devices. Because of its open and customizable
features, it is used in a wide range of electronics devices, like laptops, smart
TV, cameras, headphones, wristwatches, game consoles, car CD and DVD
players, home automations and many more [Marko Gargenta]. Android OS is
hardware independent and runs on devices from different vendors, unlike other

8
proprietary operating systems such as iOS (Apple Inc. products), Blackberry
OS (Blackberry), S40 OS (Nokia), Windows OS (Windows Phone) etc., which
are licensed and controlled by certain companies. As of May 2013, Android
dominates the smartphone market accounting 74.4% of worldwide smartphone
sales [Gartner].

Android is a full-fledged operating system and a complete software stack for


mobile devices. Android APIs are a rich set of system services wrapped in an
intuitive class files which provides easy access to several features like location,
web, telephony, Wi-Fi, media, camera , and so on. All the tools, frameworks
and software necessary to develop a mobile application are available for free .

2.3 ANDROID SOFTWARE DEVELOPMENT


Android software development is the process of creating or writing Application
software for the Android operating systems. Android application is typically
developed using the Android Software Development Kit (SDK). The Android
Software Development Kit (SDK) enables a developer to separate the
programming logic from the presentation layout (Graphical User Interface).
The control codes are written in the Java programming language, while the
presentation layout is coded in Extensible Markup Language (Leiva 2014).
Android application development is similar to other software development. It
consists of several phases. The basic steps involved in Android software
development; include, Environment Setup, Project Setup and Development,
Building, Debugging and testing and Publishing.

Environment Setup phase involves setting up the software development


environment to be used during the application development. It also involves
preparing basic testing tools to test the progress of the application being
developed. Such tools might be an Android Virtual Device (AVD) or real
Android devices. Project Setup and Development is the stage where a
developer sets-up and develops the Android application project and application
modules. The application modules hold all the application’s source codes and
resource files (for example XML files, and pictures). As the application
development progresses, there will come a phase where the application
developer would want to see what the application actually looks like and also
check if the implemented functionalities are working properly. (Android Open
Source Project 2015h.)

9
During the Building, Debugging and Testing phase the Android project is first
built into a debuggable .apk package(s), which can install and run on and
Android emulator or an Android-powered device. After building and installing
the Application on an Android powered device, the developer can check for
and debug errors manually or using the SDK debugging and logging tools.
After debugging the application, a developer should test the efficiency of the
developed application and various other aspects using the Android SDK
testing tools. The publishing phase involves releasing and distributing the
finished application to the users. figure 2 shows the Android workflow in
chronological order. (Android Open Source Project 2015h.)

figure 1: The Android App Workflow (Android Open Source Project2015h).

2.4 TECHNICAL DETAILS OF ANDROID


“Android is a software stack for mobile devices that includes an operating
system, middleware and key applications. The Android SDK provides the tools
10
and APIs necessary to begin developing applications on the Android platform
using the Java programming language.”. Android features, an application
framework, Dalvik virtual machine, integrated browser, optimized graphics,
SQLite, Media support, GSM Telephony, Bluetooth, EDGE, 3G, Wifi,
Camera, GPS, compass, accelerometer, rich development environment.
Bluetooth, EDGE, 3G, Wifi, GSM Telephony, Camera, GPS, compass, and
accelerometer are all hardware dependant. Below is a diagram showing the
major components of the Android operating system. (Android Developers
2012)

Figure 2 – Android OS Architecture. Source : Android Developers (2012).

11
2.4.1 Linux Kernel
Android uses, and relies upon the Linux version 2.6 for core system services,
such as security, memory management, process management, network stack
and driver model. The kernel also acts as an abstraction layer between the
hardware and the rest of the software stack. The Kernel has been accredited
with being one of the things that sets Android apart, with its functionality and
stability.

2.4.2 Android Runtime


Android comes ready with a set of core libraries that provide most of the
functionality available in the core libraries of the Java programming language.
The Dalvik Virtual Machine has been optimized for mobile devices. Every
application runs in its own process, with its own instance of the Dalvik virtual
machine. The format the Dalvik VM uses is the Dalvik Executable (.dex)
format. This format is optimized for minimal memory footprint. The VM is
register-based, and runs classes complied by a Java language compiler that
have been transformed into the .dex format by the included “dx” tool. The
Dalvik VM relies on the Linux kernel for underlying functionality such as
threading and low-level memory management.

2.4.3 Libraries
Android includes a set of C/C++ libraries used by various components of the
Android system. These capabilities are exposed to developers through the
Android application framework. Some of the core libraries are listed below:
- System C library - a BSD-derived implementation of the standard C system
library (libc), tuned for embedded Linux-based devices
- Media Libraries - based on PacketVideo's OpenCORE; the libraries support
playback and recording of many popular audio and video formats, as well as
static image files, including MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG
- Surface Manager - manages access to the display subsystem and seamlessly
composites 2D and 3D graphic layers from multiple applications
- LibWebCore - a modern web browser engine which powers both the
Android browser and an embeddable web view
- SGL - the underlying 2D graphics engine
- 3D libraries - an implementation based on OpenGL ES 1.0 APIs; the libraries
use either hardware 3D acceleration (where available) or the included, highly
optimized 3D software rasterizer

12
- FreeType - bitmap and vector font rendering
- SQLite - a powerful and lightweight relational database engine available to
all applications

2.4.4 Application Framework


By providing an open development platform, Android offers developers the
ability to build extremely rich and innovative applications. Developers are
free to take advantage of the device hardware, access location information,
run background services, set alarms, add notifications to the status bar, and
much, much more. Developers have full access to the same framework APIs
used by the core applications. The application architecture is designed to
simplify the reuse of components; any application can publish its capabilities
and any other application may then make use of those capabilities (subject to
security constraints enforced by the framework). This same mechanism
allows components to be replaced by the user.
Underlying all applications is a set of services and systems, including:
 A rich and extensible set of Views that can be used to build an
application, including lists, grids, text boxes, buttons, and even an
embeddable web browser
 Content Providers that enable applications to access data from other
applications (such as Contacts), or to share their own data
 A Resource Manager, providing access to non-code resources such as
localized strings, graphics, and layout files
 A Notification Manager that enables all applications to display custom
alerts in the status bar
 An Activity Manager that manages the lifecycle of applications and
provides a common navigation backstack.

2.4.5 Applications
Android will ship with a set of core applications including an email client, SMS
program, calendar, maps, browser, contacts, and others. All applications are
written using the Java programming language.
(Android Developers 2012, Web Designers Directory 2011).

2.5 WHY ANDROID AND NOT APPLE?


Android has had success over Apple. In the first quarter of 2010 for example.
In the USA, Android overtook apple and took the number two spot, just below
13
RIM (NPD 2010). Android is an open source development environment, free
to use, and free to develop for. There are more than 200million activated
Android devices, in more than 130 countries and regions. Application
downloads, and Android activations are up now activating more than 550,000
new devices each day worldwide. (Android 2012).

Figure 3. Growth in Downloads. Source : Android (2012).

14
Figure 4. Growth in Activations. Source : Android (2012).

Gartner a leading information technology research and advisory company,


stated that the Android OS rose to account for more than 50 percent of
Smartphone Sales. In the third quarter of 2011, Android OS was 52.5% of
smartphone sales, more than doubling its market share from the third quarter
of the previous year. It beat some of its biggest competitors such as Windows
7 phones, RIM and Apple for the spot. (Gartner 2011). See the table below for
a table of the statistics released by Gartner.

Worldwide Smartphone Sales to End Users by Operating System in 3Q11


(Thousands of Units)

Operating System 3Q11 3Q11 3Q10 3Q10


Units Market Units Market
Share (%) Share (%)
Android 60,490.4 52.5 20,544.0 25.3
Symbian 19,500.1 16.9 29,480.1 36.3
iOS 17,295.3 15.0 13,484.4 16.6
Research In Motion 12,701.1 11.0 12,508.3 15.4
Bada 2,478.5 2.2 920.6 1.1
15
Microsoft 1,701.9 1.5 2,203.9 2.7
Others 1,018.1 0.9 1,991.3 2.5
Total 115,185. 100 81,132.6 100
4

Figure 5 - Source: Gartner (November 2011)

Developing applications for iOS (Apples Mobile operating system), must be


done so on an Apple machine. Quoted from their website you need an - “Intel-
based Mac running MacOS X Snow Leopard or later to develop iOS apps for
the AppStore”. Additional to the costs of getting the equipment required to
devlop applications for the Apple AppStore, there is another fee.
To be an iOS developer you must pay an annual fee of $99 to create free
applications, or $299 to create applications to sell. (Apple Developer 2012).
Additional to all this, once you have paid the fees, got the equipment and made
the application you then have to submit it to apple and face possible rejection
of your application if it does not fit within the guidelines. (Apple Developer
2012). Taking this into account, along with Android's growing success, and
much cheaper development costs with them with just a $25 one off fee to
become an Android developer, Android will be the platform for the game.

2.6 STUDIES RELATING TO RISKS AFFECTING THE SOFTWARE


PROJECTS
Considerable amount of research has been conducted in the areas of risk
identification, analysis and management of software projects. Investigators in
this area have tried to identify the various risk factors that affect the success of
the software projects and have also proposed various risk management models
for better supervision of these threats. Inspite of all this, the success rate of
software projects is not very positive. Risk researchers corroborate the high
failure of software projects, estimating that one-third of software projects fail
or are abandoned. The unacceptably high rate of system failure across the
board regardless of the size or complexity of the project, has commanded
investigations of why these problems occur and what can be done to prevent
them. Furthermore, recent evidence suggests that reports from project
managers of on-going projects may be optimistically biased, distorted or even
non-reported, thereby further exasperating managers efforts to detect potential

16
project pitfalls. This section deals with various work done on identification of
risks and their mitigation.

The extant literature has produced a number of conceptual frameworks to


explain different types of software development risk, risk management
strategies and measures of software project performance. The majority of risk
management studies deals with normative techniques of managing risk . Some
empirical studies have tried to understand how one can effectively manage
software risk. Using case study data they have discussed which risk
management principles were not followed and tried to identify reasons for not
following the same. Overall, these studies provide illuminating insights into
risk management deliberations, but are weak in explaining the true impact of
risk management in generalising from observations. A few studies have gone
further to establish systematic models of risk management. They all conclude
that risk management efforts reduce the exposure to software risk and can
thereby increase software quality and improve software development. Some
studies focus solely on project delays or deals indirectly with software risks
Overall, the understanding of how software risk management can improve
software development has remained fragmented and largely anecdotal.

In terms of previous efforts to identify risk factor, Boehm’s work has probably
had more influence on practitioner‘s community than any other . Boehm
identified top ten list of software risks based on his experience in defence
industry. According to him personnel shortfalls, unrealistic schedules and
budgets, developing the wrong functions and properties, developing the wrong
user interface, gold plating, continuing stream of requirements changes,
shortfalls in externally furnished components, shortfalls in externally
performed tasks, real-time performance shortfalls, straining computer science
capabilities are the top risks that a software company faces. To manage these
risks Boehm proposed theory ―W: Make everyone a winner”. This theory
worked on two subsidiary principles: ―plan the flight and fly the plan and
identify and manage your risks. Accordingly, various mitigation strategies to
counter the above risks were proposed such as staffing with top talent,
requirement scrubbing, prototyping, reference checking, detailed multisource
cost and schedule, compatibility analysis etc. Although, the study details out
the risks and their mitigation but fails to convey the tools used to derive these
risks other than the fact that Boehm used his own experience and a survey of

17
the experienced project managers to identify these risks. According to
Ropponen and Lyytinen , the study lacks a theoretical foundation. It has
multiple items which refer to the same phenomenon.

Sherer used a three dimensional framework to explain the software risks. She
identified technical, organization and environment as three dimensions on
which the software risks were explained. To combat these risks various risk
mitigation technique were also proposed. In the study, technical risks were
identified as the most important risks affecting the software projects. Use of
HIPO charts, data flow diagrams, prototyping, simulation modelling,
benchmarking, fault tolerant methods were some of the risk management tools
proposed in the study. Her study fails to link these risks to the Software
Development Life Cycle. Moreover, the study fails to provide constructive
tools to mitigate the risks relating to software vendor relationships and
outsourcing.

Field in his article states that, ―projects fail too often because the project
scope was not fully appreciated and/or user needs not fully understood‖. He
developed a comprehensive list of pitfalls that must be avoided to execute a
successful software project. The list includes misunderstanding user
requirements, project scope ill defined, poorly managed changes; change in the
chosen technology, business needs change, deadlines unrealistic, resistant
users, lost sponsorship, lack of experienced personnel, best practice and
lessons ignored by managers. This list was re-used by Reel to adduce various
risk management strategies such as building the right team, giving team what
they need, involving customers or user in the development, setting up
procedures and expectations for high level of quality before the development,
tracking the progress religiously and institutionalizing a process for learning
from past mistakes.

Keil et al employed a variation on the traditional Delphi survey approach to


elicit opinions from a panel of experts through iterative, controlled feedback.
Groups of experienced project managers from USA, Hong Kong and Finland
were formed and list of top ten risks along with their mitigation were identified.
The list includes the following key risk factors and their mitigation: a) Lack of
top management commitment to the project, lack of adequate user involvement

18
and failure to gain user commitment; can be mitigated by relationship
management, trust building and political skills.
b) Misunderstanding the requirements and lack of frozen requirements can be
managed by educating the user/customer on the impact of scope changes in
terms of project cost and schedule; tools such as multi-criteria decision making
and function point analysis can also be used to mitigate these risks.
c) Failure to manage end user expectations, lack of required knowledge/skills
in project personnel, introduction of new technology and
insufficient/inappropriate staffing can be mitigated by internal reviews coupled
with external reviews, use of work-breakdown structure, development of
contingency plans to manage personnel shortfall and use of new technology.
d) Changing scope/objectives and conflict between user departments can only
be managed by contingency and disaster planning. Inspite of such detailed
analysis this study fails to link it with the software development cycle.

Oz et al collected quantitative and qualitative data about reasons why software


projects fail. They conducted a factor analysis of the survey and identified lack
of corporate leadership, poorly communicated goals/deliverables, inadequate
skills and means, poor project management and deviation from
timetable/budget as the key risk factors.

Ropponen and Lyytinen using survey instrument on eighty project managers


delineated six components of software development risk. These were:
scheduling and timing risks, systems functionality risks, subcontracting risks,
requirements management risks, resource usage and performance risks and
personnel management risks. They proposed various risk mitigation strategies
to extenuate the identified risk, mainly concentrating on the following:
standardization of the process, making risk management an integral part of the
project, hiring of experienced project managers and controlling or
decomposing the size of the project.

Schmidt et al developed a comprehensive list of fifty three factors affecting


the software project, using inputs from multicultural set of forty one practicing
project managers. Three panels were formed on the basis of their cultural
background and Delphi technique of decision making was used to identify the
critical risk factors affecting the software projects. The risks identified were
lack of top management commitment, failure to gain user commitment,

19
misunderstanding of requirements, lack of adequate user involvement, lack of
required knowledge/skills in project personnel, lack of frozen requirements,
changing scope/objectives, introduction of new technology, failure to manage
end user expectations, insufficient/inappropriate staffing, conflict between user
departments.

Jiang et al made use of software risk measurement instrument pertaining to


various characteristics of a software development projects developed by Barki
et al and pointed out that project size, application complexity, technology
acquisition, insufficient resources, lack of team expertise, lack of user support,
lack of user experience, lack of clear role definition, intensity of conflicts are
the top nine risk factors that a software project can be exposed to.

According to the study conducted on the Indian software industry, the Indian
software industry is not only facing the problem of attrition from the home
front but is also facing problem from the client side as well. There were a
number of cultural and political issues that US managers perceive as irritants
or barriers. One such issue is the apparent unwillingness of Indian software
professionals to point out potential problems up-front, and in general, an
unwillingness to say no for fear of offending the clients. Another related
weakness is the lack of familiarity of many Indian firms and professionals with
the work culture and work norms in the west, and especially in the United
States. Other difficulties include resistance within the US to foreign
programmers, poor telecommunication infrastructure, and the delays in
obtaining the required visas for Indian programmers.

Addison and Vallabh conducted a three phase Delphi survey of the South
African software industry and identified unclear or misunderstood
scope/objectives, misunderstanding the requirements, failure to gain user
involvement, developing the wrong software functions, unrealistic schedule
and budgets, continuous requirement change, inadequate knowledge/skills,
lack of effective project management methodology, gold plating as the key risk
factors. They also studied the effectiveness of various controls or strategies to
reduce the occurrence of risk factors. They found that experienced project
managers use controls such as assigning of responsibilities to team members
and stabilizing requirements and specifications more than inexperienced

20
project managers. The study lacked in the area of data collection as the sample
size taken was too small to generalize the risks and their mitigation strategy.

DeMarco and Lister identified schedule flaw, requirements inflation,


employee turnover, specification breakdown and poor productivity as the core
risk factors of software development projects. While Lu and Ge analysed the
risk of software development projects in two aspects - one for owners (project‘s
feasibility and knowledge management problem) and another for contractors
(scope change risk and management risk) in China using AHP technique.

In-depth interview with IT professionals from leading firms in Australia were


undertaken by Baccarini et al to ascertain the IT risks and their mitigation.
The top ten risks identified in the study were: personnel shortfalls,
unreasonable project schedule and budget, unrealistic expectations, incomplete
requirements, diminished window of opportunity due to late delivery of
software, continuous changes to requirements by client, poor production
systems performance, poor leadership, inadequate user documentation, lack of
agreed user acceptance testing and sign-off criteria. Rich and valuable array of
mitigation techniques were identified and categorised as avoidance, reduction,
transfer or acceptance strategies. However, the study failed to provide any
framework for software risk management.

In a study conducted by Smith in Africa, lack of top management commitment


to the project, unclear/misunderstood objectives, schedule flaw, lack of client
responsibility; ownership and buy-in of the project and its delivered systems,
no planning or inadequate planning, project not based on sound business case,
lack of available skilled personnel, not managing change properly, lack of
adequate user involvement, poor risk management came out to be the major
risk factors affecting the software project.

Costa et al. in their study presented a technique for assessing the risk level of
a software project based on its systemic and specific risks. They introduced an
approach to estimate the probability distribution of earnings and losses
incurred by an organization according to its software project portfolio. This
technique was supported by an empirical study to assess the relative
importance of risk factors for software development projects. The following
risk factors were keyed out: client risk, control risk, analysis risk, team risk,

21
testing risk, policies/organization structure risk and design risk. However, no
attempt was made in the study to address the issue of managing and mitigating
these risks.

Dey et al through a case study on TCPO in Barbados identified the key risk
factors as: the unavailability of key personnel, employee turnover and
incorrect/incomplete requirement. The study also developed an integrated
framework for managing risk in software development with the involvement
of the stakeholders in TCPO. To control risks in the project they proposed
constant project monitoring, dynamic scope management plan, involvement of
client in the development process and effective communication between
developer and client as some of the strategies for mitigating the risks.

Verner et al. conducted an exploratory statistical analysis to identify


determinants of project success and used logistic regression to predict project
success. According to the study, success is more likely to happen if the project
manager is involved in schedule negotiations, adequate requirements
information is available when the estimates are made, initial effort estimates
are good, take staff leave into account, and staff are not added late to meet an
aggressive schedule. The study is quite comprehensive as far as prediction of
project success is concerned but it does not cover all the factors that affect the
success of the project. Defining success only from the perspective of
estimation, staffing and scheduling is incomplete in itself.

Zhou et al analysed ten case studies in the UK, USA and New Zealand to
identify critical risk factors (scope creep, unwillingness of customer to accept
final systems, poor project management, etc.) at the pre-implementation and
implementation stage of the software project. The study is limited to
identification of risks at pre-implementation and implementation stage and
ignores the risk occurring in post-implementation stage of software projects.
The study fails to provide any insight into the risk management and mitigation
strategies.

Bannerman conducted a study in government agencies in Australia to


investigate the practices of a state government in dealing with software
projects. Analysis of the study uncovered ten categories of risk factors
namely: project governance, project setup, partner engagement, business

22
proprietorship, project management, change management, management of
projects, recognition of red flags, management of risk and benefit realization.
The study also identified the various risk management techniques used in
these projects. Overall, the study aimed at reviewing and reassessing the
status of risk management research in literature and practices in a sample of
Australian public sector agencies. The study is helpful as it provides a
complete understanding of risk and risk management in public sector.
Whether the same can be applied in private sector software companies is not
clear from the study.

Iacovou et al identified lack of top management commitment, original set of


requirements miscommunicated, language barrier in project communications,
inadequate user involvement, lack of offshore project management know-
how by client, failure to manage end user expectations, poor charge control,
lack of business know-how by offshore team, lack of required technical
know-how by offshore team and failure to consider all costs as the core risk
factors. The study aimed at providing an insight into risks affecting offshore
– outsourced development projects but fails on delivering the risk
management techniques to combat these risks.

Anudhe et al using case-based methodology and structured and semi-


structured interviews with senior management of various Indian software
companies keyed out various risk factors affecting the software projects.
Schedule and budget management (developing a collaborative work culture
with clients), client expectations (educating the client to involve deep level of
association with the customer), requirements capture (elaborate data
collection and proactive analysis), staffing (maintaining buffer resources,
involving client in resource recruitment), changes in client‘s corporate
structure (transparency and adequate communication) are few of the risk
factors and its mitigation mentioned in their study. However, the study fails
to define any model for risk management.

Thus, it can be clearly seen that numerous researches have been devoted to the
identification and management of the software risk. Various methodologies
have been used for keying out the list of major risk factors. As a result, there
have been various lists of risk factors with some similarities and some
differences. Therefore, a comprehensive and exhaustive list encompassing all

23
the risk factors affecting the software projects is prepared in the following
section.

2.7 EXISTING SYSTEM


Although there are number of web-based and android based applications which
are, one way or other related to quiz, however, there are only few that help in
learning and contribute to the academic enhancement of the students. Most of
the available applications are aiming at having a fun or entertainment. Among
the many applications, I reviewed some Web based and Android based
applications that are quite famous and are successful in terms of amount of
players and downloads.

2.8 WEB-BASED APPLICATIONS


Following is the detail of some of the selected web-based systems.

2.8.1. JAGRAN Josh Computer General Knowledge Quiz


Computer General Knowledge Quiz section is a repository of Multiple Choice
Question that make you aware about evolving nature of competitive
examination, this quiz is about subjects related to computer field. It’s a general
computer quiz. This quiz is useful for the preparation of any computer field
test. In this quiz app, questions are given along with four choices, and at the
end the correct choice is also given. After preparation, students can check their
level of preparation through the quiz . A snapshot of this system is shown in
Fig. 6.

24
Figure 6: JAGRAN Josh Computer General Knowledge Quiz

2.8.2 TreeKnox Computer Quiz


TreeKnox Computer Quiz (Fig. 7.) is a quiz system for the help and preparation
of computer science and IT students who are going to appear in any interview,
tests or exams in computer science and IT field. Questions are given along with
multiple choices and at the end of each question, a button named “Answer” is
given. On clicking that button the correct answer is highlighted at the mean
time.

25
Figure 7. TreeKnox Computer Quiz

2.9 ANDROID BASED


Following is the detail of an android-based systems.

2.9.1 Quiz app


This quiz application (Fig. 8) is very simple and interactive. In this there are
two modes General and Aptitude, after selecting one of them it will be redirect
to the Quiz interface which will contain question with multiple answers
(options) and contain three buttons “Submit”, “Show Answer” and “Next” .

26
Figure 8. Quiz App.

Although there are many apps that focus on quiz, but there are limited
applications with focus on learning or improving knowledge in curriculum
area. Most of the other apps are entertainment- based with little focus on
educational paradigm.

There are many limitations with the existing systems mentioned above. To
overcome such limitations, we propose an offline and user-friendly
application, which mainly focuses on gaining knowledge as well as
entertainment. Therefore, when one is amazed with playing the quiz, he/she is
gaining curriculum knowledge with emphasis on not only gaining good grades
but also having better understanding of the subject matter.

Other unique features of Quiz application that is lacking in other apps is the
simplicity, User friendly interface and the fact that the app can be used without
internet access unlike most quiz apps that require internet access before they
can be accessed. Other features regarding the Quiz app and other apps seemed
to be quite similar, i.e. answering questions with multiple choices , scoring as
high as possible and so on.

27
CHAPTER 3
METHODOLOGY

3.0 INTRODUCTION
Methodology is an early phase in development system. It is included into this
chapter to see how the project will be developed. A plan must be drawn up to
guide the development towards the project goals. Methodology is the study of
methods or a body of method. It may be defined as a collection of procedures,
techniques, tools and documentation aids. These may help the software
developers to speed up and simplify the software development process. A
methodology consists of a set of phases that in turn may consist of sub-phases.
These phases are important in guiding the developers to the choice of
techniques at various stages in the project. Additionally, a methodology helps
the developers to plan, manage, control and evaluate information system
project.

A lot of methodology models in existence currently, after done several


researches on methodology, researcher decided to have multi-method research.
The methods are system dynamics methodology for developing a human
resource planning model and prototyping methodology for web-based
development. Multi-methods research involves using more than one type of
research technique or data source within a study. It was argued that using
multiple methods could enhance confidence in the findings, in particular by
increasing the ability to evaluate convergent and discriminant validity. Multi-
strategies research may be a better way to conceptualise research designs
involving qualitative and quantitative elements (Bryman, 2001).

3.1 CHOSEN METHODOLOGY


3.1.1 SYSTEM DEVELOPMENT
System development is a standard process or flow of the methodology to
structure all steps necessary to analyze, design, implement and test the system.
It is important when we want to develop the system.

System Development Life Cycle (SDLC) can be known as the process of


creating or altering systems, and the models and methodologies that people use
to develop systems. SDLC is a system approach to problem solving and is
made up of several phases, each comprised of multiple steps. There are various

28
SDLC methodologies have been developed to guide the processes involved. In
general, an SDLC methodology follows the following steps:

1. The existing system is evaluated. Deficiencies are identified. This can be


done by interviewing users of the system and consulting with support
personnel.

2. The new system requirements are defined. In particular, the deficiencies in


the existing system must be addressed with specific proposals for
improvement.

3. The proposed system is designed. Plans are laid out concerning the physical
construction, hardware, operating systems, programming, communications
and security issues.

4. The new system is developed. The new components and programs must be
obtained and installed. Users of the system must be trained in its use, and all
aspects of performance must be tested. If necessary, adjustments must be made
at this stage.

5. The system is put into use. This can be done in various ways. The new
system can phased in, according to application or location, and the old system
gradually replaced. In some cases, it may be more cost-effective to shut down
the old system and implement the new system all at once.

6. Once the new system is up and running for a while, it should be exhaustively
evaluated. Users of the system should be kept up-to-date concerning the latest
modifications and procedures.

Benefits of using a SDLC methodology include:


 Has a proven framework
 Consistency and uniformity - methods and functions
 Results/Deliverables
 Facilitates information exchange
 Defines and focuses on roles and responsibilities
 Has a predefined level of precision to facilitate a complete, correct and
predictable solution.

29
 Enforces planning and control

figure 9.SLDC Phase

3.2 DEVELOPMENT PHASE


3.2.1 Planning Phase
At this stage, the first task, is to identify the programming software and
programming language that will be suitable for designing the application and
implement the codes for better execution. The focuses in this stage will be:

1. Find tools to develop the interface of the system depending on the input
below:

a) Color image or grayscale image (type of image)

b) JPEG,PNG,TIFF,BITMAP (format image)

2. Identify the tools to develop the system

3. Plan the steps to implement the function in development progress

30
The result of the planning phase will be reported for the system that being
applied. Therefore the planning purpose is crucial part to implement.

3.2.2 Analysis Phase


This phase required the knowledge on planning phase to be structured and
discuss. Therefore, a detail research for all the problems are important to be
understand, especially the flow of the algorithm of the programming must be
structured well based on the objective of the application. At this stage there are
some important things that must be highlighted to continue the phases until it
well structured. There are needed for me to research the algorithm or coding in
programming on how the to make each buttons function as I want and to make
the app interactive, this determination require me to do lot of research based
on other researches that has to do with software development. Besides, there
are some important things such as, the resulting from this phase is to ensure
that the coding is well functional based on the requirement purpose that have
been recommended.

3.2.3 Design Phase


The primary objective of the design phase is to create a design that satisfies the
agreed application requirements. In the design phase the SDLC process
continues to move from the “what” questions of the analysis phase to the
“how” questions. In this phase, the application that chosen from analysis phase
will be constructed and codified. Then, the application that being develop from
the logical phase are transformed into computing vision, which is by
implement the technology details with the specified tools to develop in
physical phase. The application needs a prototype or output from the system to
be implemented, therefore the requirement to develop the application need a
detailed function or coding for the techniques to be codified into it.

3.2.4 Implementation Phase


In this phase there will be described about how the designs are translated into
code. This phase will include the information in which is the algorithm will be
coded and tested. The implementation part also needs a programming tool like
software like android studio to create the graphical user interface for the
prototype of the application. Requirement for this implementation will include:

31
1) Interface:
It’s required to create a user friendly environment or layout to guide a users
and make the app easy to navigate. The layout views to be used for the app
must be decided before starting the project and the interface will be designed
with xml.

2) Coding:
The program will need a function to generate the algorithm that will be applied
to the target image. This coding is necessary to build the program to run
successfully. This is the harder part that I face, that must be implement, if error
occur while compilation is doing, the program must be corrected and there
must have some adjustment to be done especially the coding part.

3) Prototype:
Here, the prototype of the program is to show the initial part of the application
to the users, for them to evaluate it before implementation and also consider
their suggestions.

3.2.5 Testing phase


In this phase, the software will be tested. Normally, programs are written as a
series of individual modules, this subject to separate and detailed test. The
software is then tested as a complete system. While the error can be detect in
this stage, it is a good way to know how this project will be done successfully
and the application also can be improved. This program will be tested first to
the programmer to ensure their coding run successfully. System will be test
gradually to improve the maintenance of the software, maintenance is related
to the testing phase because of this project is not a big system but this is the
application that needs an interaction between users with the system.

3.3 METHODS IMPLEMENTATION


The methods that being used to develop an application will have an important
data that must be collected and analyzed first. The data gathered is the
information that will help users or anybody that have an interest in software
development. Therefore, the important data that is being captured need a best
technique to gather all the data needed.

32
3.3.1 Current Program/Application
The current algorithm and techniques that have already been implemented in
the application will be the guidance for me to do an observation . Therefore,
there are necessary for me to do a research towards this application which can
give me a comparison on which algorithm to be applied in this project.

3.3.2 Internet/Journal/Book
The information about the algorithm and techniques can be found through the
book, but the information that can get from the internet much more large and
spacious. There are various researches about the current techniques on
software development that can be found from the journal in the internet.

3.3.3 Discussion With Supervisor


In order to ensure that this project in a right track, I make an appointment with
my supervisor to meet him often. It is important to discuss with the supervisor
before I can make a decision to choose which techniques is suitable to be
implemented.

33
CHAPTER 4
SYSTEM DESIGN & IMPLEMENTATION

4.1 ANDROID USER INTERFACE HIERARCHY


Designing the application’s user interface was an important part of the project.
The aim of each interface was to provide to the user a friendly and usable
environment. Android SDK provides to the developer a variety of User
Interface components (UI) or controls such us structured layout, buttons and
radio buttons. As with any programming language that supports UI design
there is a hierarchy of objects. This is also the case for the Graphical UI (GUI)
of android applications. The GUI for an Android application is built using the
hierarchy of View and ViewGroup objects. View objects are UI widgets such
as spinners, radioButtons or checkboxes. On the other hand ViewGroups are
containers that define how the child view objects are displayed on the screen.
Figure 4.1 shows the hierarchy of an Android GUI. The UI in an Android
application is defined by an XML vocabulary. The XML file corresponds to
the subclasses of View and ViewGroup.

Figure 10. ViewGroup Container; Children View components

34
4.2 CHOICE OF PROGRAMMING LANGUAGES
4.2.1 Java Programming Language
As mentioned before in the report, the Java programming language was chosen
for the purpose of the project. The main reason for choosing Java was because
Android development primarily relies on it. As Reto Meier highlights in his
book, even though development can be achieved using low-level languages C
or C++, developers are required to understand the specific hardware they are
coding for. Thus, writing code using C/C++ is a difficult and complicated task,
something that made these approaches outmoded. However, by introducing
Java hosted MIDlets, applications that make use of the Mobile Information
Device Profile (MIDP), there was a revolutionary shift in software industry for
smartphones. MIDlets are executed on a Java Virtual Machine (JVM), a
process that abstracts the hardware and enables developers to build
applications that run on devices that support Java run time. As a consequence,
Java became the most popular programming language for developing android
applications.

The popularity of the Java programming language combined with the openness
of the Android OS, enabled the developers to share information and solutions
which they encounter using the same language. As a result, the internet has
become an excellent source for support and exchange of ideas between the
developers for Android. By taking into account the above factors, combined
with the fact that Java is extensively taught as part of our course, led to the
decision of choosing Java as the main programming language for this project.

4.2.2 XML
The GUI (Graphical user interface) was developed using XML (Extensible
Markup Language), but controlled with Java programming language.

35
4.3 SYSTEM REQUIREMENT
System requirement are the properties that a system must have in other for a
hardware or software application to run smoothly and efficiently. Failure to
meet these requirements can result in installation problems or performance
problems.

Hardware- A computer system with the following properties


 RAM – 4GB or Higher
 Hard disk – Minimum of 2GB free space
 Operating System (Windows 8)

Software
 Android Studio (IDE)
 Photoshop cs6
 Android emulator

4.4 GUI DESIGN


The Graphical User Interface (GUI) was designed to fulfil all the requirements
of the project as stated in Chapter 3 above. The client side interface is made up
of 3 user interfaces which are the main menu, about screen and question screen.
The interfaces are as shown below.

4.4.1 Main Menu


The main menu is the first interaction of the user with the application. The
visual structure of the main menu was arranged with relatively. Each item in
the list represents a button redirecting the user to a feature. The choice of the
specific layout aims to improve the overall usability of the application since
most of the users are familiar with similarly arranged and styled menus. Figure
11. shows the design of the main menu. It consists of One ImageView, and
four buttons

36
37
Figure 11: Main menu.

4.4.2 About Screen


The next screen is “About” screen (Fig. 12), which is simply like an
introduction. It contains details about the creator of the application, the purpose
of creating the application and what the application is generally.

38
39
Figure 12: About screen.
4.4.3 Question screen
The Question screen (Fig. 13 and 14) is used to show Question with multiple
answers (options) for the user to help him/her to answer the question correctly
and at any time user can see the score progress status on the top of this screen.
This screen has a button below the options that can be click on at any time to
quit the application. The Question screen consist of view groups, radio buttons,
Textviews and two button.

40
41
Figure 13: Question screen.

42
43
Figure 14: Question screen.

4.5 IMPLEMENTATION
The implementation of the project adhered strictly to the application
requirements as stated in chapter 4. The project was developed in the Android
studio integrated development environment (IDE) using the Android software
development kit (Android SDK Tools). The application is targeted at any
Android mobile device running at least Android 2.2, which corresponds to
API level 8 up to the latest Android SDK Version. As at the time of writing
this report, Android 4.4.2 (Android KitKat) API level 19 is the latest Android
SDK Version.

The application is made up of several java classes among which are the activity
classes that are responsible for displaying the graphical user interface GUI and
also for manipulating data for this application. In other words, an activity class
normally takes care of the creation of a window in which user interface (UI)
can be placed.

The overview of the project structure in Android studio is as shown in the


diagram below.

44
Figure 16: Java class structure

Figure 17: activity structure

The java classes contained in the application package are responsible for
displaying different UI in the application and for data manipulation. The data
45
package contains all data management java classes. The library package
contains library classes while util package contains a java class to display the
user result. The contents of the packages are as shown in the diagram below:

Figure 18. Application Java Classes.

4.5.1 Main Screen Activity Class


The class is responsible for displaying the application start page. It has three
buttons to take the user to either the question page, about page or exit the
application. If the start button is clicked by the user, the code snippet that gets
executed is shown below:

Snippet 4. update score.

4.6 TESTING
After writing all the source code and fixing all the major bugs, the testing done
for the application was carried out on android emulator and real Android
mobile device - Samsung Galaxy, Gionee and Infinix. The screen of the mobile
46
phone was printed and saved to a file with the help of default Screenshot and
snipping tool software program. The software basically displays the screen of
any Android mobile device connected to a computer on the computer screen
and whatever application running on the phone will be displayed
simultaneously on the computer.

47
48
49
Figure 19: result

50
51
CHAPTER 5
SUMMARY & CONCLUSION

5.0 SUMMARY
Most of the goals set at the beginning of the project for this application have
been achieved with its implementation. There are quite a few parts of the
application which I found challenging. The most difficult part of the
implementation was finding a way to hold the set of questions retrieved from
the database and displaying them in a view with their set of options one after
the other. For this problem, I created a class to hold all question object and
added them to an array. To display each of the questions, I only needed to
iterate through the array using the position of each of the elements in that array.

5.1 CONCLUSION
The goal of this project was to develop mobile quiz application for Android
device, with user friendly interface. These goals have been successfully
achieved on completion of this project. The project was tested on both Android
emulator and Android mobile device. The application ran smoothly and the UI
components responded as expected.

REFERENCES
[1] Selecting a development approach, 2007 [online].[Accessed 15th April
2013].
Available from: http://www.cms.gov/Research-Statistics-Data-and-
Systems/CMS-Information-
Technology/XLC/Downloads/SelectingDevelopmentApproach.pdf

52
[2] Android SDK. (2013). [Online]. Available:
http://developer.android.com/sdk/index.html
[3] Android UI Testing. (2013). [Online]. Available:
http://developer.android.com/tools/testing/testing_ui.html
[4]http://www.testcurrentaffairs.com/2015/08/top-100-computer-quiz-
questions-and-answers.html
[5] http://placement.freshersworld.com/computer-quiz-2/33121979385
[6] Android Activity. Official Android Developer Reference website.
Accessed
30.05.2014.http://developer.android.com/reference/android/app/Activity.html
[7] Android (operating system). Wikipedia Foundation. Accessed 30.05.2014.
http://en.wikipedia.org/wiki/Android_%28operating_system%29
[8] Nigeria - Mobile Market - Overview, Statistics and Forecasts. Accessed
28.05.2014.
http://www.budde.com.au/Research/Nigeria-Mobile-Market-Overview-
Statisticsand-Forecasts.html
[9] Mobile Apps. (2010). Mobile Apps Group. Retrieved from
http://www.informatics-ventures.com/connect/mobile-apps-group
[10] Software Engineering - Olayanju Taiwo Abolaji Computer Department,
Federal College of Education (Tech.) Akoka, Lagos

53
SOURCE CODE
Activity_main.xml:
Main Activity XML
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:orientation="vertical"
android:scrollbars="vertical"
tools:context="com.example.android.quizproject3.MainActivity">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ede7f6"
android:orientation="vertical">

<TextView

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:shadowColor="#9E9E9E"
android:text="@string/welcome_note"
android:textColor="#673ab7"
android:textSize="24sp"
android:textStyle="bold"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"

android:text="@string/You_think_you_know_the_continent_well_Provide_your_name_to_conti
nue"

54
android:textColor="#424242"
android:textSize="16sp"
android:textStyle="bold"/>

<EditText
android:id="@+id/name_field"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:hint="@string/name"
android:inputType="textCapWords"
android:textColor="#000000"
android:textColorHint="#616161"
android:textSize="20sp"/>

<TextView
android:id="@+id/question_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:fontFamily="sans-serif"
android:text="@string/question_1"
android:textColor="#000000"
android:textSize="16sp"
android:textStyle="bold">

</TextView>

<TextView

android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:fontFamily="sans-serif"
android:text="@string/question_1_content"
android:textColor="#000000"
android:textSize="14sp"
android:textStyle="normal">

</TextView>

<RadioGroup
android:id="@+id/question_one_radio_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<RadioButton
android:id="@+id/marcus_garvey_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"

55
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/marcus_garvey"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/nnamdi_azikwe_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/nnamdi_azikwe"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/derek_walcott_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/derek_walcott"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/malcolm_x_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/malcolm_x"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

</RadioGroup>

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:background="#757575" />

<TextView
android:id="@+id/question_two"
android:layout_width="wrap_content"

56
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:fontFamily="sans-serif"
android:text="@string/question_2"
android:textColor="#000000"
android:textSize="16sp"
android:textStyle="bold">

</TextView>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:fontFamily="sans-serif"
android:text="@string/question_2_content"
android:textColor="#000000"
android:textSize="14sp"
android:textStyle="normal">
</TextView>

<RadioGroup
android:id="@+id/question_two_radio_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<RadioButton
android:id="@+id/sixth_july_1967_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/sixth_july_1967"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/fifteen_january_1966_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/fifteenth_january_1966"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/sixteen_June_1968_radio_button"

57
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/sixteenth_june_1968"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/sixth_April_1966_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/sixth_april_1966"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

</RadioGroup>

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:background="#757575" />

<TextView
android:id="@+id/question_three"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:fontFamily="sans-serif"
android:text="@string/question_3"
android:textColor="#000000"
android:textSize="16sp"
android:textStyle="bold"/>

<TextView

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:fontFamily="sans-serif"
android:text="@string/question_3_content"
android:textColor="#000000"
android:textSize="14sp"
android:textStyle="normal" />

58
<RadioGroup
android:id="@+id/question_three_radio_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<RadioButton
android:id="@+id/hundred_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/hundred"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/one_seventy_five_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/one_seventy_five"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/one_hundred_and_nine_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/one_hundred_and_nine"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/one_hundred_and_eight_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/one_hundred_and_eight"
android:textColor="#000000"
android:textSize="14sp"

59
android:theme="@style/RadioButtonStyle"/>

</RadioGroup>

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:background="#757575" />

<TextView
android:id="@+id/question_four"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:fontFamily="sans-serif"
android:text="@string/question_4"
android:textColor="#000000"
android:textSize="16sp"
android:textStyle="bold"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:fontFamily="sans-serif"
android:text="@string/question_4_content"
android:textColor="#000000"
android:textSize="14sp"
android:textStyle="normal" />

<RadioGroup
android:id="@+id/question_four_radio_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<RadioButton
android:id="@+id/tenth_nov_1991_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/tenth_november_1991"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton

60
android:id="@+id/eleventh_feb_1990_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/eleventh_february_1990"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/twelfth_feb_1991_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/twelfth_february_1991"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/ninth_march_1989_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/ninth_march_1989"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>
</RadioGroup>

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:background="#757575" />

<TextView
android:id="@+id/question_five"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:fontFamily="sans-serif"
android:text="@string/question_5"
android:textColor="#000000"
android:textSize="16sp"
android:textStyle="bold"/>

61
<TextView

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:fontFamily="sans-serif"
android:text="@string/question_5_content"
android:textColor="#000000"
android:textSize="14sp"
android:textStyle="normal" />

<RadioGroup
android:id="@+id/question_five_radio_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<RadioButton
android:id="@+id/ghana_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/ghana"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/zimbabwe_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/zimbabwe"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/nigeria_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/nigeria"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

62
<RadioButton
android:id="@+id/senegal_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/senegal"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>
</RadioGroup>

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:background="#757575" />

<TextView
android:id="@+id/question_six"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:fontFamily="sans-serif"
android:text="@string/question_6"
android:textColor="#000000"
android:textSize="16sp"
android:textStyle="bold"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="14dp"
android:fontFamily="sans-serif"
android:text="@string/question_6_content"
android:textColor="#000000"
android:textSize="14sp"
android:textStyle="normal" />

<RadioGroup
android:id="@+id/question_six_radio_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<RadioButton
android:id="@+id/year_1962_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:paddingEnd="24dp"

63
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/nineteen_sixty_two"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/year_1952_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/nineteen_fifty_two"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/year_1980_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/nineteen_eighty"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/year_1960_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/nineteen_sixty"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>
</RadioGroup>

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:background="#000000" />

<TextView
android:id="@+id/question_seven"
android:layout_width="wrap_content"

64
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:fontFamily="sans-serif"
android:text="@string/question_7"
android:textColor="#000000"
android:textSize="16sp"
android:textStyle="bold"/>

<TextView

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:fontFamily="sans-serif"
android:text="@string/question_7_content"
android:textColor="#000000"
android:textSize="14sp"
android:textStyle="normal" />

<RadioGroup
android:id="@+id/question_seven_radio_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<RadioButton
android:id="@+id/uganda_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/uganda"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/angola_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/angola"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/ethiopia_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

65
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/ethiopia"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/congo_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/congo"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>
</RadioGroup>

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:background="#757575" />

<TextView
android:id="@+id/quetion_eight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:fontFamily="sans-serif"
android:text="@string/question_8"

android:textColor="#000000"
android:textSize="16sp"
android:textStyle="bold"/>

<TextView

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:fontFamily="sans-serif"
android:text="@string/question_8_content"
android:textColor="#000000"
android:textSize="14sp"
android:textStyle="normal" />

<RadioGroup
android:id="@+id/question_eight_radio_group"

66
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<RadioButton
android:id="@+id/walter_sisulu_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/walter_sisulu"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle" />

<RadioButton
android:id="@+id/govan_mbeki_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/govan_mbeki"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/walter_rodney_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/walter_rodney"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/oliver_tambo_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/oliver_tambo"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>
</RadioGroup>

67
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:background="#757575" />

<TextView
android:id="@+id/question_nine"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:fontFamily="sans-serif"
android:text="@string/question_9"
android:textColor="#000000"
android:textSize="16sp"
android:textStyle="bold" />

<TextView

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:fontFamily="sans-serif"
android:text="@string/question_9_content"
android:textColor="#000000"
android:textSize="14sp"
android:textStyle="normal" />

<RadioGroup
android:id="@+id/question_nine_radio_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<RadioButton
android:id="@+id/sudan_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/sudan"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/egypt_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"

68
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/egypt"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/djibouti_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/djibouti"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/gambia_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/gambia"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>
</RadioGroup>

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:background="#757575" />

<TextView
android:id="@+id/question_ten"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:fontFamily="sans-serif"
android:text="@string/question_10"
android:textColor="#000000"
android:textSize="16sp"
android:textStyle="bold"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"

69
android:layout_marginTop="14dp"
android:fontFamily="sans-serif"
android:text="@string/question_10_content"
android:textColor="#000000"
android:textSize="14sp"
android:textStyle="normal"
/>

<RadioGroup
android:id="@+id/question_ten_radio_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<RadioButton
android:id="@+id/fifty_four_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="14dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/fifty_four"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/_seventy_two_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/seventy_two"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/sixty_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/sixty"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>

<RadioButton
android:id="@+id/seventy_four_radio_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"

70
android:layout_marginStart="16dp"
android:paddingEnd="24dp"
android:paddingLeft="24dp"
android:paddingStart="24dp"
android:text="@string/seventy_four"
android:textColor="#000000"
android:textSize="14sp"
android:theme="@style/RadioButtonStyle"/>
</RadioGroup>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">

<Button
android:id="@+id/clear_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:layout_weight="1"
android:text="@string/clear"
android:textSize="14sp"
android:textStyle="bold"/>

<Button
android:id="@+id/submit_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:layout_weight="1"
android:text="@string/submit"
android:textSize="14sp"
android:textStyle="bold"/>

</LinearLayout>

</LinearLayout>

</ScrollView>

71
JAVA File –The Application Logic MainActivity.java
JAVE File
package com.example.android.quizproject3;
import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioGroup;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {


int score = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

// Get the id of the button that submits the quiz


final Button submitButton = (Button) findViewById(R.id.submit_button);
submitButton.setEnabled(true);

// Set a click listener on the button

submitButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {

//Access the RadioGroup view and save it to a variable.


RadioGroup radioGroup = (RadioGroup)
findViewById(R.id.question_one_radio_group);

//Get the id of the RadioButton that is checked and save it


//as an integer variable.
int solutionId = radioGroup.getCheckedRadioButtonId();

//Use if statements to respond based on whether


//it is the id of the correct answer.
if (solutionId == R.id.derek_walcott_radio_button) {
score += 10;
} else {
score += 0;
}
//Access the RadioGroup2 view and save it to a variable.
RadioGroup radioGroup2 = (RadioGroup)
findViewById(R.id.question_two_radio_group);

//Get the id of the RadioButton that is checked and save it


//as an integer variable.

72
int solutionId2 = radioGroup2.getCheckedRadioButtonId();

//Use if statements to respond based on whether


//it is the id of the correct answer.
if (solutionId2 == R.id.sixth_july_1967_radio_button) {
score += 10;
} else {
score += 0;
}

//Access the RadioGroup3 view and save it to a variable.


RadioGroup radioGroup3 = (RadioGroup)
findViewById(R.id.question_three_radio_group);

//Get the id of the RadioButton that is checked and save it


//as an integer variable.
int solutionId3 = radioGroup3.getCheckedRadioButtonId();

//Use if statements to respond based on whether


//it is the id of the correct answer.
if (solutionId3 == R.id.one_hundred_and_nine_radio_button) {
score += 10;
} else {
score += 0;
}

//Access the RadioGroup4 view and save it to a variable.


RadioGroup radioGroup4 = (RadioGroup)
findViewById(R.id.question_four_radio_group);

//Get the id of the RadioButton that is checked and save it


//as an integer variable.
int solutionId4 = radioGroup4.getCheckedRadioButtonId();

//Use if statements to respond based on whether


//it is the id of the correct answer.
if (solutionId4 == R.id.eleventh_feb_1990_radio_button) {
score += 10;
} else {
score += 0;
}

//Access the RadioGroup5 view and save it to a variable.


RadioGroup radioGroup5 = (RadioGroup)
findViewById(R.id.question_five_radio_group);

//Get the id of the RadioButton that is checked and save it


//as an integer variable.
int solutionId5 = radioGroup5.getCheckedRadioButtonId();

//Use if statements to respond based on whether


//it is the id of the correct answer.
if (solutionId5 == R.id.zimbabwe_radio_button) {
score += 10;
} else {
score += 0;
}

//Access the RadioGroup6 view and save it to a variable.

RadioGroup radioGroup6 = (RadioGroup)


findViewById(R.id.question_six_radio_group);

73
//Get the id of the RadioButton that is checked and save it
//as an integer variable.
int solutionId6 = radioGroup6.getCheckedRadioButtonId();

//Use if statements to respond based on whether


//it is the id of the correct answer.
if (solutionId6 == R.id.year_1962_radio_button) {
score += 10;
} else {
score += 0;
}
//Access the RadioGroup5 view and save it to a variable.
RadioGroup radioGroup7 = (RadioGroup)
findViewById(R.id.question_seven_radio_group);

//Get the id of the RadioButton that is checked and save it


//as an integer variable.
int solutionId7 = radioGroup7.getCheckedRadioButtonId();

//Use if statements to respond based on whether


//it is the id of the correct answer.
if (solutionId7 == R.id.ethiopia_radio_button) {
score += 10;
} else {
score += 0;
}

//Access the RadioGroup5 view and save it to a variable.


RadioGroup radioGroup8 = (RadioGroup)
findViewById(R.id.question_eight_radio_group);

//Get the id of the RadioButton that is checked and save it


//as an integer variable.
int solutionId8 = radioGroup8.getCheckedRadioButtonId();

//Use if statements to respond based on whether


//it is the id of the correct answer.
if (solutionId8 == R.id.walter_rodney_radio_button) {
score += 10;
} else {
score += 0;
}

//Access the RadioGroup5 view and save it to a variable.


RadioGroup radioGroup9 = (RadioGroup)
findViewById(R.id.question_nine_radio_group);

//Get the id of the RadioButton that is checked and save it


//as an integer variable.
int solutionId9 = radioGroup9.getCheckedRadioButtonId();

//Use if statements to respond based on whether


//it is the id of the correct answer.
if (solutionId9 == R.id.sudan_radio_button) {
score += 10;
} else {
score += 0;
}

//Access the RadioGroup5 view and save it to a variable.


RadioGroup radioGroup10 = (RadioGroup)
findViewById(R.id.question_ten_radio_group);

74
//Get the id of the RadioButton that is checked and save it
//as an integer variable.
int solutionId10 = radioGroup10.getCheckedRadioButtonId();

//Use if statements to respond based on whether


//it is the id of the correct answer.
if (solutionId10 == R.id.fifty_four_radio_button) {
score += 10;
} else {
score += 0;
}

submitButton.setEnabled(false);

EditText nameField = (EditText) findViewById(R.id.name_field);


String name = nameField.getText().toString();
Context context = getApplicationContext();
CharSequence text = name + " Your score is: " + score + " points out
of a possible 100 points";
int duration = Toast.LENGTH_LONG;
Toast toast = Toast.makeText(context, text, duration);
toast.show();

});

// Get the id of the button that clear the result of the quiz
Button clearButton = (Button) findViewById(R.id.clear_button);

// Set a click listener on the button

clearButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
score = 0;
submitButton.setEnabled(true);

// clear the selected radio button in the radio group


RadioGroup radioGroup = (RadioGroup)
findViewById(R.id.question_one_radio_group);
radioGroup.clearCheck();

// clear the selected radio button in the radio group


RadioGroup radioGroup2 = (RadioGroup)
findViewById(R.id.question_two_radio_group);
radioGroup2.clearCheck();

// clear the selected radio button in the radio group


RadioGroup radioGroup3 = (RadioGroup)
findViewById(R.id.question_three_radio_group);
radioGroup3.clearCheck();

// clear the selected radio button in the radio group


RadioGroup radioGroup4 = (RadioGroup)
findViewById(R.id.question_four_radio_group);
radioGroup4.clearCheck();

// clear the selected radio button in the radio group


RadioGroup radioGroup5 = (RadioGroup)

75
findViewById(R.id.question_five_radio_group);
radioGroup5.clearCheck();

// clear the selected radio button in the radio group


RadioGroup radioGroup6 = (RadioGroup)
findViewById(R.id.question_six_radio_group);
radioGroup6.clearCheck();

// clear the selected radio button in the radio group


RadioGroup radioGroup7 = (RadioGroup)
findViewById(R.id.question_seven_radio_group);
radioGroup7.clearCheck();

// clear the selected radio button in the radio group


RadioGroup radioGroup8 = (RadioGroup)
findViewById(R.id.question_eight_radio_group);
radioGroup8.clearCheck();

// clear the selected radio button in the radio group


RadioGroup radioGroup9 = (RadioGroup)
findViewById(R.id.question_nine_radio_group);
radioGroup9.clearCheck();

// clear the selected radio button in the radio group


RadioGroup radioGroup10 = (RadioGroup)
findViewById(R.id.question_ten_radio_group);
radioGroup10.clearCheck();

// clear the name in the edit text field


((EditText) findViewById(R.id.name_field)).setText("");
Context context = getApplicationContext();
CharSequence text = "You ready to go again?";
int duration = Toast.LENGTH_LONG;
Toast toast = Toast.makeText(context, text, duration);
toast.show();

});

76

You might also like