background image

 

analyze  his  app’s  modes  of  execution,  by  creating  diagrams 
with the actions of users. 

Figure 4. 

 

Flow diagram of user actions 

Starting the quiz game, the user can choose the “behavior” 

of  the  device.  Figure  4  shows  that  there  are  three  options  of 
execution.  The  first  is  about  hosting  an  online-web  game 
(server),  and  the  second  about  a  client  in  a  network  game. 
These two options use networking technologies (Bluetooth Wi-
Fi).  The  third  option  is  about  the  single  use  that  does  not 
require any networking technology. 

After  that,  the  choices  the  user  has  when  connecting as  an 

administrator are being analyzed. If he chooses to host a game, 
the device starts transmitting the beacon in order for the clients 
to  discover  his  device.  When  networking  technologies  are 
disabled, the user is notified with an alert message to enable at 
least one of  networking technologies. Then, he waits for other 
clients  to  connect,  with  the  maximum  number  of  three.  Once 
the  connection  is  completed,  he  chooses  the  time  and  the 
questions that he is going to play with the rest of the players. 

As  a  client,  the  user  sees  the  available  servers  and  he 

connects to one of them. When all the clients are connected, the 
server sets the game, and the first question is appeared. 

Finally, we have the function of single user. By selecting to 

play alone, the user selects the category and then sets the time 
and  the  questions.  Networking  technologies  are  not  needed  in 
this option.  

III.

 

A

NALYSING AND DESIGNING THE DATABASE

 

Usually,  mobile  applications  have  to  store  data.  This  can 

either be fulfilled by means of a file, or by a database, or in a 
web location. Each one of these techniques has its advantages 
and  disadvantages.  For  storing  the  data,  we  have  decided  to 
use a database created by SQLite [2], because of the size that 
it  occupies.  Its  use  is  ideal  for  devices  where  memory  and 
process power are limited. 

Before beginning coding, developer should begin with the 

creation  of  the  external  files.  These  files  usually  consist  of 
graphic  features  such  as  button  images,  or  a  database.  All 
external  files  will be added to his total project  when he starts 
coding. In case of a database, in order to achieve a functional 
and  working  database,  the  developer  should  determine  the 
architecture of his application and the roles of its users. 

This method helped us in our application and we achieved 

to  optimize  our  database.  As  a  result,  we  created  only  two 
tables for the quiz game instead of six. 

A.

 

Architecture 

The  developer  has  to  determine  the  architecture  of  his 

application  so  that  he  can  simplify  his  project  and  start 
implementing  it  step  by  step.  Our  system  is  based  on  two 
different categories of implementation. In the first one, we use 
the client-server model with bidirectional communication. That 
means that we communicate and share information between all 
devices  on  the  creation  of  the  game.  In  the  second  case,  we 
only use the system in which a simple extraction of data to the 
user is being done. 

In the first case, the system supports up to four users, one of 

them  being  the  host  of  the  game.  For  this  function,  a 
connection  via  wireless  networks  from  the  server  is  being 
created  and  starts  sending  information  to  the  rest  of  the 
available clients. The  entire  game  architecture is based on  the 
message packets between server and clients. 

In  the  second  case,  we  have  a  different  approach  to  the 

game.  We  have  a  single  user  who  receives  on-screen 
information about the game.  

B.

 

Roles of the system 

In  our  application  we  analyzed  all  possible  roles  and 

operational  flows,  in  order  to  construct  the  database.  Due  to 
lack of space we will present only one flow of execution for the 
administrator role. The user who chooses to use the application 
in communication protocols IEEE 802.11 (Wi-Fi) - Bluetooth, 
is defined as an administrator and becomes the local server that 
will host the remaining players. 

Basic operational flow for administrator role  

 

In this use case, the administrator starts the host game 
by selecting the corresponding button. 

 

Then, he/she enters the name of his/her preference for 
the creation of the local server that will host the game. 

 

He/She  waits  for  the  other  players  who  wish  to 

connect to the administrator’s network to do it. 

 

After  the  number  of  the  available  players  is 
completed, he/she selects "Start". 

 

Then, the form for selecting the question categories is 
displayed. 

 

The administrator has the option to select one or more 
of them if he/she wishes. 

 

Finally,  by  pressing  the  button  "Start",  he/she  also 
defines the desired duration time of the game, and the 
number of the questions on which he/she will compete 
with the rest connected users. 

Alternative flow - Canceling creating the local server 

Administrator  has  the option  to cancel the impending  start 

of  the  game  that  has been  created  whenever  he/she  wishes  by 
clicking on the "X" at the bottom left of the game form.