Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The app design will follow the MVC pattern ( as all of our mobile apps this semester ) . There will be 3 model classes,

The app design will follow the MVC pattern (as all of our mobile apps this semester). There will be 3 model classes, 2 views, and 2 controllers.
Begin by creating a new Android project in Android Studio, named according to the lab guidelines - project name should be abc123-lab4, Set the minimum SDK of the project to API 26.
Your application will read in data from files placed in the assets folder. Create a new assets folder in your project, and move the sample files into it.
Add the following in the edu.utsa.cs3443.abc123_lab4.model package:
All classes from Lab 2(includes Starship, CrewMember, and Fleet)
You can copy these over from your earlier lab, however be sure to (1) review them for any mistakes, and (2) copy the files - do not link to them - this creates a link on your local machine but does not export with your project. Use basic copy and paste to avoid this.
Your app should also contain:
MainActivity.java - in the edu.utsa.cs3443.abc123_lab4 package
StarshipActivity.java - in the edu.utsa.cs3443.abc123_lab4 package (use the new activity wizard to create this activity)
activity_main.xml - in the res > layout folder
activity_starship.xml - in the res > layout folder
Sample images
Download Sample images
Open this document with ReadSpeaker docReader
- extract and place images in the res > drawable folder
fleet.csv
Download fleet.csv
Open this document with ReadSpeaker docReader
- in the assets folder
personnel.csv
Download personnel.csv
Open this document with ReadSpeaker docReader
- in the assets folder
Remember to ensure your app works on the same version of Android we are using in class, and in the emulator. Graders will use the same version to test your app.
App Design:
The View:
Your app will show a view similar to the one shown in the first image to the left below when the app is run in the emulator. This view displays a logo and at least 3 buttons, each with the name (and registry) of a starship. This screen will be the activity_main.xml.
When the user chooses one of the displayed buttons, the app will bring them to the second screen, activity_starship.xml. An example is shown in the second image below. You may customize your app however you choose - this includes fonts, images, colors, configuration. This app must have the described GUI components on each screen.
Any images shown in the samples below have been provided. If you choose to use them (or you may optionally find your own images).
The Controller:
MainActivity.java will launch when the application is run, and show the activity_main.xml.
MainActivity will have implementation for the View.OnClickListener interface using Anonymous Inner Classes to enable the buttons to listen to user clicks from the buttons on the GUI.
When the user clicks on a button for a starship, the StarshipActivity should call upon a model class to load the data from the given files (in the assets folder) and return the information for the requested Starship and CrewMembers. This information will be displayed on the second screen.
Controllers in your application should never read files or update data. Instead, to follow MVC, the controller classes will call upon the model classes to complete these tasks.
The Model:
All model classes from the previous lab can be reused - see that lab description for full descriptions of each class. You may add to these classes as needed to implement this lab, however be sure to retain their original implementations as well - do not remove or modify basic components (e.g. a Starship still has CrewMembers).
Unlike the previous lab, we will not hard-code our data to create a Starship or CrewMember. Instead, this data is provided in fleet.csv and personnel.csv. Load the data needed from these files (note that we will only read from the files in this lab - there will be no writing).
The second screen displays information about the chosen Starship, so there should be a method in either Fleet or Starship to enable this, reading the data from the provided file(s). The StarshipActivity class will call on this method. All personnel (all crew members) for a starship should be listed, along with their photo, title/rank, name, and position.
All classes in the model must always have Javadoc comments, getters and setters for all class variables. Constructors are required for all required variables in a class.
If your model classes contains more information, that is fine, however if that extension interferes with the requirements of this lab, you may lose credit.
Notes:
The second screen displays information about the chosen Starship, so there should be a method in either Fleet or Starship to enable this, reading the data from the provided file(s). The Starship controller class will call on this method. All personnel (all crew members) for a starship should be listed, along with their photo, title/rank, name, and position.
The data files are not always in order -

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

Students also viewed these Databases questions

Question

Explain the process of MBO

Answered: 1 week ago