Android application

profileNikshiptha
ProjectComponent4.pdf

Project Component 4: Server-side Business Logic and Android Client Mobile App

Dr. Wassim Itani Project Topic: Design of a database system for a frequent flier program Project Collaboration Model: This project component should be developed in a team of 2 members minimum and 4 members maximum. You cannot work independently without a team. Due Date/Time: 05/04/2023 11:59:59 PM. Deliver the .ZIP file (other formats won’t be accepted) containing: (1) your frequentflier web folder (refer to part 1), (2) your FreqFlier Android Studio project folder (refer to part 2), (3) a vlink.txt file containing a link to a 15-min recorded video demonstrating the operation of your application (refer to part 3), and (4) a Readme.txt file on Blackboard by the above due date/time. The Readme.txt file should contain the name of the group and the names and GMU IDs of the members. Each member should submit the same copy of the ZIP file on Blackboard to secure an entry in the Grade Center. Your .zip file should be named as follows: P4_[Your Last Name]_[Your GMUID].zip. For instance, if John Smith with GMUID: G12345678 were to submit this file, John would name it: P4_Smith_G12345678.zip. Check the validity of your ZIP file before uploading. Any corrupted ZIP file will result in a grade of ZERO. In this last project component you will be relying on the FrequentFlier database you created in the previous project components to develop the Java server-side code supporting part of your FrequentFlier application. Moreover, you will be developing an extremely simplified mobile application to work with the server-side code. This should consitute a simple but complete end-to-end database application following the 3-tier enterprise model. Once you develop this basic background, you will hopefully realize that any complex application simply relies on the basic constructs you used in this project. Part 1 (60%) The server-side code is comprised of 1 Java Servlet and 7 Java Server Pages. You should abide by the following guidelines in detail to ensure a smooth grading process for the GTAs. Create a folder named frequentflier in the webapps folder of your Apache Tomcat Server. This folder should contain all your JSP files and any resources you might need when developing the client application. It also contains the WEB-INF/classes folder containing the .class and .java files of the Login Servlet. You are required to develop the JDBC code to implement the following Java Server-side components. Your JDBC code typcially follows the same exact steps as we did in the lectures. What changes is the query to send to the database. Accordingly start by developing the SQL queries needed in each server component and then build the JDBC code and test it from a browser session. A good convention to follow when you have a response output from an SQL statement is to separtate the columns by a particular character and the rows by another character to facilitate the process of parsing the response in the Android mobile app later. Use a ‘,’ to separate the columns and a ‘#’ to separate the rows. Java Servlets Login.java (5% for correct code, 2.5% for successful execution) Annotation reference name: /login Request input parameters: passenger username and password Response output:

- The String “Yes:pid” if the username and password combination is valid and exists in the LOGIN table in the database. pid is the passenger id.

- The String “No” if the username or password are incorrect URL format: http://127.0.0.1:8080/frequentflier/login?user=certainuser&pass=certainpass

Java Server Pages Info.jsp (5% for correct code, 2.5% for successful execution) Request input parameters: A passenger id Response output: The passenger name, the number of points collected by the passenger. URL format: http://127.0.0.1:8080/frequentflier/Info.jsp?pid=certainpid Flights.jsp (5% for correct code, 2.5% for successful execution) Request input parameters: A passenger id Response output: the flight id, flight miles, and destination for all the flights belonging to the specified passenger id. URL format: http://127.0.0.1:8080/ frequentflier /Flights.jsp?pid=certainpid FlightDetails.jsp (5% for correct code, 2.5% for successful execution) Request input parameters: The flight id. Response output: the flight dept_datetime, flight arrival_datetime, flight miles, trip ids, and trip miles belonging to the specified flight id. URL format: http://127.0.0.1:8080/frequentflier/FlightDetails.jsp?flightid=certainflightid AwardIds.jsp (5% for correct code, 2.5% for successful execution) Request input parameters: A passenger id Response output: the distinct award ids belonging to the specified passenger id. URL format: http://127.0.0.1:8080/frequentflier/AwardIds.jsp?pid=certainpid RedemptionDetails.jsp (5% for correct code, 2.5% for successful execution) Request input parameters: an award id and a passenger id Response output: the award description, the number of points needed, redemption date, and exchange center name for the specified (award id, passenger id) pair. URL format: http://127.0.0.1:8080/frequentflier/RedemptionDetails.jsp?awardid=certainawardid&pid=certainpid GetPassengerids.jsp (5% for correct code, 2.5% for successful execution) Request input parameters: the current passenger id Response output: the passenger ids in the database excluding the current passenger id URL format: http://127.0.0.1:8080/frequentflier/GetPassengerids.jsp?pid=currentpid TransferPoints.jsp (5% for correct code, 2.5% for successful execution) Use 2 UPDATE SQL DML statement in this JSP file. The first one to deduct the number of points from the current passenger point account and the second one to add the specified number of points to a particular passenger id. Request input parameters: a passenger id and the number of points to be transferred to the point account of this passenger. Response output: A message indicating that the transfer is successful. URL format: http://127.0.0.1:8080/frequentflier/TransferPoints.jsp?pid=certain pid& &npoints=certainnumberofpoints Part 2 (30 %) [5% per activity] In this part you will develop an Android client application project (name it FreqFlier) to demonstrate a small portion of your project operation. Due to the limited amount of time available, your app will consist of few activities for testing the interaction of your server-side code with the database. The Figures provide

an idea of the UI anticipated for the activities and a specification of the server-side components that may be used to support the implementation of those activities.

MainActivity Relies on the Login Servlet

MainActivity2 Relies on Info.jsp to fill the passenger name and number of points. You should have .jpeg photos for 5 sample passengers (you can pick any sample photos of individuals from the Web). Name each photo according to the following scheme: pid.jpeg (pid is the passenger id). Store the images in an images folder under the frequentflier application folder on Apache Tomcat. MainActivity2 should request the photo of the specified passenger id to display it.

MainActivity3 Relies on Flights.jsp to fill the flights information.

MainActivity4 Relies on: (1) Flights.jsp to fill the spinner with the flight ids belonging to the passenger id (2) FlightDetails.jsp to fill the flight departure date/time, flight arrival date/time, flight miles and trip ids and miles.

MainActivity5 Relies on: (1) AwardIds.jsp to fill the spinner with the award ids of the passenger id (2) RedemptionDetails.jsp to fill the award description and points needed for the selected award id. Moreover, it fills the redemption dates and exchange center names belonging to the (award id, passenger id) redemption information.

MainActivity6 Relies on: (1) GetPassengerids.jsp to fill the spinner with passenger ids excluding the current passenger. (2) TransferPoints.jsp to increase the point accounts of the passenger id selected in the spinner with the number of points entered. This JSP should decrease the amount of points from the current passenger id.

Part 3 (10 %) Each group will record a 15-min video demonstration of their application and post the video to YouTube (or any video hosting service). A link to the video should be included in the vlink.txt file. Any broken link or a link that is not accessible will result in a ZERO grade. Don’t upload the whole video file to Blackboard. All the group members should participate in the project demonstration. The following is what should be emphasized on in your video: 1. The code of the different Server-side components (Servlet and JSPs) (2.5%) 2. The Java code of the Android Activities (2.5%) 3. Testing each of the Server-side components using a browser session (2.5%) 4. Running the Android activities with the Android Studio emulator and demonstrating their functionality and interaction with the Servlet and JSPs (2.5%)