Douchebag Jar the Instant Karma App
Total Page:16
File Type:pdf, Size:1020Kb
Douchebag Jar The Instant Karma App A fullstack mobile application development project Douchebag Jar The Instant Karma App Ett fullstack utvecklingsprojekt för mobilapplikationer Frida Nilsson Dan Gryttman The Faculty of Health, Science and Technology Computer Science Bachelor Thesis 15hp Supervisor: Katarina Asplund Examiner: Jonathan Vestin Date: 20210531 Preface We want to thank our supervisors at Ubitech AB, Martin and Viktor, for your guidance, your patience and for your dedication. We would also like to thank our supervisor Katarina for helping us with the thesis, and reminding us that a thesis is also part of a project. Finally, we want to thank Elin, as she is the reason why we needed an app like this. i ii PREFACE Abstract Mobile applications are everywhere in today’s society, they come in many flavours and are an integral part of many peoples daily lives. The limits to development of mobile applications are expanding with each new idea of how the technology could be potentially used, and it is a field that is most likely going to continue to influence the world we live in. In this thesis, the objective was to develop a proof of concept for a mobile application for social interaction which is tightly anchored to the real world. The idea of the "Douchebag Jar" application was intended as a way for friends and coworkers to stay connected and keep having fun at each other’s expense by introducing a karma-based punishment/redemption system. The goal was to learn about mobile application devel- opment and the technologies behind it, get first hand experience with app development and become familiarised with tools used by professional app developers. The process of development involved researching and incorporating a number of technologies (e.g. cloud hosted databases) to create an application that was as complete as possible, within the given time frame. As a result of this project, a stable and func- tional version of the Douchebag Jar application was created and successfully deployed on multiple Android devices. The journey towards the finished proof of concept of the application was a learning experience in which various fields of computer science was delved into. iii iv ABSTRACT Contents Preface i Abstract iii List of Figures x List of Tables xi 1 Introduction 1 1.1 Problem description ............................ 2 1.2 Purpose and goal ............................. 2 1.3 Ethics and society ............................. 3 1.4 Methodology ............................... 4 1.5 Stakeholders ................................ 5 1.6 Delimitations ............................... 5 1.6.1 Pandemic ............................. 5 1.6.2 Time ............................... 6 1.7 Work Distribution ............................. 6 1.8 Disposition ................................ 6 2 Background 7 2.1 .NET .................................... 9 v vi CONTENTS 2.2 Xamarin.Forms .............................. 9 2.3 Prism ................................... 11 2.4 Entity Framework ............................. 12 2.4.1 Language Integrated Query (LINQ) ............... 14 2.5 Microsoft Azure .............................. 14 2.5.1 Cloud computing in general ................... 15 3 Implementation 17 3.1 Overview ................................. 17 3.2 Back end ................................. 19 3.2.1 Cloud hosted back end ...................... 19 3.2.1.1 Server and SQL database ............... 19 3.2.1.2 Web API ........................ 19 3.2.1.3 Authentication Service ................ 24 3.2.2 Local back end .......................... 24 3.2.2.1 Authentication ..................... 25 3.2.2.2 Authorisation ..................... 25 3.2.2.3 Database accesses ................... 26 3.2.2.4 ViewModels ...................... 26 3.3 Front end ................................. 27 3.3.1 XAML .............................. 28 4 Result 31 5 Discussion 35 5.1 Cloud hosted back end .......................... 35 5.2 Local back end .............................. 36 5.3 Front end ................................. 38 CONTENTS vii 5.4 Working methods ............................. 38 5.5 Conclusion ................................ 39 References 40 Appendix 48 A Work distribution: implementation, thesis 51 B Code implementation: databinding for lists of lists 55 C Application: views 57 viii CONTENTS List of Figures 2.1 MVVM .................................. 12 3.1 An overview of the mobile application in relation to the cloud hosted back end. ................................. 18 3.2 An overview of the architectural pattern in the mobile application .... 18 3.3 Database design. ............................. 20 3.4 Overview of the structure handling HTTP requests with database querys 21 3.5 A model representing the User entity in the database .......... 21 3.6 The model representing the Crime-entity ................. 23 3.7 Configuration of relationships and keys in database entity models .... 24 3.8 Overview of data binding for lists of lists ................. 27 3.9 Wireframe of the View showing the users Jars .............. 29 3.10 View showing the users Jars ....................... 29 3.11 NavigationPages defined by TabbedPage ................. 30 B.1 Code snippet from JarsPage.xaml showing the ListView binding to My- JarCollection and the properties contained ................ 55 B.2 Code snippet from JarsPageViewModel.cs showing the ObservableCol- lection<JarViewModel> properties, MyJarCollection and FriendsJarCol- lection ................................... 56 B.3 Code in JarViewModel .......................... 56 ix x LIST OF FIGURES C.1 Login Page ................................ 58 C.2 Account Page ............................... 59 C.3 Crime History Page ............................ 60 C.4 Jar Page .................................. 61 C.5 Owned Specific Jar Page ......................... 62 C.6 Friend’s Specific Jar Page ......................... 63 C.7 Settings Page ............................... 64 C.8 About Page ................................ 65 List of Tables 3.1 NuGet packages installed ......................... 23 A.1 Work distribution implementation .................... 52 A.2 Work distribution thesis .......................... 53 xi xii LIST OF TABLES Chapter 1 Introduction Today smartphones and social media are a prevalent source of entertainment and social interaction between friends, family and coworkers, often through games or liking each others photos [1, 2]. The impact of the smartphone in today’s society is proven by the sheer amount of active users worldwide which are around 3.6 billion users [3]. Thus it is relevant to continue developing meaningful and useful things in an area which affects a myriad of individuals. Our goal is to develop a proof of concept (PoC) of a mobile application for human interaction that connects to real life actions directly, while allowing plenty of space for each groups individual humor and jargon. The application that is to be developed was inspired by the comedy tv-series New Girl [4], in which a group of friends have implemented a punishment system referred to as "The douchebag jar". The douchebag jar is simply a glass jar, in which members of the group must put money upon behaving "douchey". The concept reminds one of the classical swear jar. The mobile application is meant to allow users to create virtual douchebag jars for their different social circles, to which they may force their friends to pay virtual tokens for arbitrary reasons defined by the users themselves. Tokens paid to a jar can thereafter be redeemed by the paying user by verifying in the app that they have performed an act 1 2 CHAPTER 1. INTRODUCTION of goodness, also defined by the users themselves. The design and functionality of the app should be intuitive, appealing and easy to use for an every day person. Creating such an app means delving into the various fields of knowledge that has been taught during our time as university students and immersing ourselves further into software engineering, trying out technologies which are previously unfamiliar to us and marrying them together with the help of documentation and guidance from the dedicated supervisors from Ubitech AB. 1.1 Problem description Mobile applications can be developed for as many reasons as can be imagined, they have their uses within our daily lives as well as in industries and many other areas. What they have in common is that they are usually meant to be used by humans in a frequent manner [5]. This means that mobile applications usually must be, among other things, responsive, user-friendly and maintain a reasonable level of performance at a reasonable cost. The question we are asking ourselves before going into development is: do the technologies used in this project offer the tools needed to make a responsive, user-friendly, maintainable app at a high enough performance level at a reasonable cost? 1.2 Purpose and goal The purpose of this degree project is to see if it is possible to develop an application for social interaction based on actions outside of the application. The goals are: • To make as good an application as we could with the time we had. • To learn about the techniques, tools and technologies used in professional app- development. 1.3. ETHICS AND SOCIETY 3 1.3 Ethics and society Throughout the recent years the question about sustainability has grown more important, due to the arising issues of global warming and other threats to our environment [6]. Applications have a part in this as they use energy when being developed as well as in use.