-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to wiki for my 2021 capstone project, DDapp.
On this wiki you'll find an introduction to the app, a general overview of each file in the project, and development/design documents.
DDapp is a java based android app that seeks to let users catalogue and manage Dungeons and Dragons character sheets on their mobile device. It consists of a frontend to allow users to view, add, and delete character sheets, and a backend RoomDatabase to handle storing character data.
This project consists only of myself as designer and programmer.
All design documents can be found under Master -> Documentation.
This is a rough paper prototype of the app.
This folder contains the two screenshots of current screens in-app.
The frontend consists of a recycler view fragment for displaying a list of characters, a details fragment for displaying detailed information about a specific character, a 'create new character' activity for allowing the user to create new characters, and a 'edit character' activity to allow users to edit characters.
The main activity for DDapp primarily exists to pass context to, and direct the user to, the RecyclerViewFragment and NewCharacterActivity. On creation the recyclerview fragment is loaded by a fragment manager. The only other elements are the top bar and a floating action button to allow the user to add new characters.
This fragment consists of a recycler view for displaying data from the database. This fragment also facilitates creating new DetailsFragments from the position referenced by the user's click.
This fragment is used to display a clicked character's data to the user. This fragment relies on information provided by the CharacterListAdapter in order to populate it's associated views with the relevant character's information.
This fragment also provides the user the ability to delete and modify characters via the action bar's options menu. These operations are facilitated by the DetailsViewModel and EditCharacterActivity activity.
This activity is responsible for allowing users to add new characters. It uses application context to pass user inputted character data to the MainActivity, where it is then inserted using the insert method in DetailsViewModel.
This activity is responsible for allowing users to add edit existing characters from the DetailsFragment. Existing character data is put into a bundle which is then used to populate a scroll view of EditText fields. Users can then change the fields as they wish and save their changes. Application context is used to return the new data to the DetailsFragment, which then uses the update method to update the database.
The backend consists of a recycler view adapter, a view model, a Room entity class, a Data Access Object, a repository class, and a RoomDatabase class.
This adapter class serves to populate the recycler view with data from the Room database. It requires a CharacterRepository instance as a parameter in order to be able to pull data from the RoomDB. The Adapter populates the recycler view based on the position of the character in the database.
It also provides a method to create a new bundle of data with all of a character's information in it to facilitate creating new DetailsFragments. This method is also used to provide the data needed to populate the recycler view.
This class facilitates communication between the view and the model. Whenever an activity or fragment wants to change data in the database it has to use one of the methods here as an intermediary to begin the process.
This entity class serves to create the character table, define the schema of the table, provide get methods, and populate the database with initial data.
This class is used to interact with the internal database to insert new characters, delete characters, and update existing characters in the character table
This class holds references to the CharacterDAO, a list of all characters in the database, and the database itself. It also provides methods for modifying the database. These methods are then referenced by DetailsViewModel to provide the ability to modify the database from the view.
This RoomDatabase class creates a new database when the app first is opened after installation, or a reference to the existing database if one already has been created. If there is no database yet, the new database is populated with test data. Currently it runs on the main thread since the amount of data being processed is small, but in the future the database could be built and queried on a new thread.