Skip to content
Bi Banh Bao edited this page Mar 18, 2018 · 8 revisions

Welcome to the privacy-friendly-boardgame-clock wiki!

Functionality of privacy-friendly-boardgame-clock

Privacy Friendly Boardgame Clock can be used with its different functionalities to count time while playing board games. The main functionalities are:

  • 5 different Clock Modes - Clockwise, counter-clockwise, random order, manual sequence and time tracking mode. Other than that there are different properties like chess clock, infinite game time, reset round time after each round or increase round time after each round.
  • resuming saved games
  • the counting happens in an foreground service. The app can be killed or shuted down while counting without interfering with the counting result
  • player management and player history. Player can also import player from contacts
  • game history is kept
  • export/import a backup file (read/write permissions in storage is required)

Used Technology and Libraries

  • unified PFA Design is used through out the app
  • the app supports SDK from 21 to 27

Introduction to futher development

packages and app structure explained

org.secuso.privacyfriendlyboardgameclock.activities

This package contains every single activity of the App. The App consists of only activities and DialogFragments. In order to avoid Bugs and Errors, Activitys are prefered over Fragments. First up one can see that each item on the Navigation Drawer represents an Activity:

  • Main - MainActivity
  • Player Management - PlayerManagementActivity
  • Game History - GameHistoryActivity
  • Backup - BackUpActivity
  • Help - HelpActivity
  • About - AboutActivity Moreover almost every Activity in this app extends from BaseActivity. In the BaseActivity the ground structure of the Activity and common Methods are declared. Therefore each Activity which extends from the BaseActivity must implement the method "getNavigationDrawerID".

org.secuso.privacyfriendlyboardgameclock.database

This package consists of 4 classes which are responsible for the communication with the database. All the necessary methods for the communication with the database are defined in the 2 classes GamesDataSourceSingleton and PlayersDataSourceSingleton. The Singleton classes can be accessed with the getInstance method. Before accessing the database, this must be opened with the open() method. And when the App is closed completely, close() method must be called in order to prevent memory leakage. Other than that, list of games, players can be retrieved and manipulated from the database with the existing methods such as: getAllGames, getSavedGames, createGame, etc. Moreover GamesDataSourceSingleton is also used to pass Game Instance between class. However this is dangerous because Android Process can be killed and Data can be corrupted. Therefore the method _checkIfSingletonDataIsCorrupt _ will be called each time an activity starts in order to check if the data is corrupted. In case of corruption, the app will be returned to the Main Page.

org.secuso.privacyfriendlyboardgameclock.fragments

This package consists of 7 DialogFragments classes. Those are the only Fragments being used through out the whole projects. Fragments are used for example when a dialog is showed to show information about a game, game result or when a player is created or edited. A whole activity is not necessary for this job. Also the whole display is not needed for this job, only a small fraction of the Display. For this reason I thought DialogFragments are best suited for this job. Based on the PFA Design the onCreateDialog Method must be implemented when a DialogFragment is created, so the design stays close to Android Native Design.

org.secuso.privacyfriendlyboardgameclock.helpers

This package contains following stuffs:

  • Adapters: Every List in the app needs an adapter to process and show the data. Every selectable list should extend from the abtract class SelectableAdapter. In this abstract class necessary and unified structure are already definied for example methods such as getSelectedItemCound, toggleSelection, isSelected, etc.
  • Others Helper Classes for example custom numberpicker, TAGHelper (A class which contains TAGs only)

org.secuso.privacyfriendlyboardgameclock.model

This package consists of 2 models: Game and Player objects

org.secuso.privacyfriendlyboardgameclock.services

This package consists of 3 Service Classes:

  • CountdownTimerService: This Service is responsible for counting down time for all Time Mode except for time tracking mode
  • TimeTrackingService: This Service is responsible for tracking time in time tracking mode
  • DetectTaskClearedService: This Service is used to detect that the app is killed from the process. Originally this is used to detect when the app is killed, so the database can be closed. However this is currently not used, because even if the app is killed, the service keeps on running and in that case, the database should still be opened.

All Services run in foreground mode and the app can be killed without influencing the running service.

org.secuso.privacyfriendlyboardgameclock.tutorial

This package is responsible for the Tutorial appearing the first time using the App.