Subject Module Project in Computer Science
Total Page:16
File Type:pdf, Size:1020Kb
Subject Module Project in Computer Science Exam group number: S2026631-3 Project title: Server Liquid Dispenser Group Members: Andreas Work - 66712 - [email protected] Bastian Inuk Christensen - 66523 - [email protected] Frida Valles Kirkegaard - 65451 - [email protected] Simon Damtoft Bjergø - 66818 - [email protected] Supervisor: Sune Thomas Bernth Nielsen Date: 03/06-2020 4th semester - spring Number of characters: 58.600 Number of standard pages: 25 Bjergø – 66818 S2026631-3 03-06-2020 Christensen – 66523 Roskilde University 4th semester Kirkegaard – 65451 Subject Module Project - CS Work – 66712 1.0 Abstract This paper seeks to streamline the process of ordering and automate the creation of drinks. While a machine for creating drinks was proposed was not completed. The paper starts out exploring the project management methodology. Here the project made use of user stories, Kanban and a use case diagram. User stories were used to find the scope of the project. Kanban was used for time management and use case diagram was used to further develop the use for the app. Only an app for android and server is made. The server is made in the language Swift using Vapor as a framework. The server would be used by admins or owners of the machines and would contain the drinks available. The server also contains a database of the users who signed up using the app. The app was made in the IDE android studio in the language Java. The app would be used by customers to sign up and order. The app and server communicate using HTTP headers. The project concludes with a system with the quintessential parts of the streamlining, but further development and a machine to create the drinks are needed, before real life implementation is possible. 2 Bjergø – 66818 S2026631-3 03-06-2020 Christensen – 66523 Roskilde University 4th semester Kirkegaard – 65451 Subject Module Project - CS Work – 66712 Tabel of Content 1.0 Abstract ................................................................................................................................................................................. 2 2.0 Introduction ......................................................................................................................................................................... 4 3.0 Problem formulation ........................................................................................................................................................... 5 4.0 Preparation .......................................................................................................................................................................... 5 4.1 User stories ................................................................................................................................................................................... 5 4.2 Kanban ......................................................................................................................................................................................... 8 4.3 Use case diagram ....................................................................................................................................................................... 10 5.0 The Server - Code Explanation ......................................................................................................................................... 11 5.1 What is a server? ........................................................................................................................................................................ 11 5.1.1 What is a database? .......................................................................................................................................................... 12 5.1.2 REST & API ........................................................................................................................................................................ 12 5.2 Language and Framework Choice ............................................................................................................................................. 13 5.2.1 Swift ................................................................................................................................................................................... 13 5.3 Communication with the Machine ............................................................................................................................................ 14 5.4 Communication with the App .................................................................................................................................................... 17 5.4.1 Algorithm .......................................................................................................................................................................... 17 5.5 Limitations of the Code .............................................................................................................................................................. 18 5.5.1 Known bugs of our Code ................................................................................................................................................... 19 5.6 Testing ........................................................................................................................................................................................ 19 6.0 The Autobar app - Code Explanation ............................................................................................................................... 22 6.1 Languages .................................................................................................................................................................................. 22 6.1.1 Java .................................................................................................................................................................................... 22 6.1.2 XML ResourCes .................................................................................................................................................................. 23 6.2 Main Activity .............................................................................................................................................................................. 23 6.2.1 ServerRequest ................................................................................................................................................................... 27 6.3 SignUpActivity ............................................................................................................................................................................ 28 6.3.1 LoginType ......................................................................................................................................................................... 28 6.4 MainMenuActivity ...................................................................................................................................................................... 30 6.5 SupportEmail ............................................................................................................................................................................. 33 6.6 OrderDrinkActivity .................................................................................................................................................................... 34 6.7 Testing ........................................................................................................................................................................................ 36 7.0 Discussion ........................................................................................................................................................................... 37 8.0 Conclusion .......................................................................................................................................................................... 38 9.0 Perspectivation .................................................................................................................................................................. 39 10.0 Bibliography .................................................................................................................................................................... 40 3 Bjergø – 66818 S2026631-3 03-06-2020 Christensen – 66523 Roskilde University 4th semester Kirkegaard – 65451 Subject Module Project - CS Work – 66712 Github Links This project has two accompanying git repositories, these can be found on the following links, marked which part of the project they belong to. The app and server can likewise be found in the zip file in the appendix. Server: https://github.com/BastianInuk/DrinkServer App: https://github.com/PlanInAdvanc/Drinkapp 2.0 Introduction In our everyday life, it is a very common occupation to go to bars and enjoy a good time with friends. But as technology develops, people are getting more impatient at the speed of a human, wanting everything, such as Cuba Libre, faster than ever. And in recent times, an even bigger problem, hygiene, has come up. For those reasons, this project seeks to find a way to streamline bars more efficiently, so it would make more money, satisfy customers and at the same time be more sanitizable. To do this, the concept coined ‘Autobar’ was created, where the customer could order