scieee AI-readable full text Open interactive document viewer

Development of an Android application as a personalised visual rehabilitator for patients with macular degeneration

Escobar Suarez, Daniela Alejandra; Martín Puebla, Alba María; Núñez Conde, María; Rodríguez Pereira, Diego Alejandro

Abstract

The Age-related Macular Degeneration (AMD) is an illness that creates one or more stains in the vision that may affect significantly in the everyday life of whoever suffers it. It is a disease that afflicts mostly to people of advanced age and, nowadays, their treatments are not modernized to the digital era. In the present day, it is mainly tested and exercised through paper, as there is not enough investment to digitalize, which would make easier the treatment of the patient, therefore, make easier the professional work. The objective of this project is to develop an application that helps both patients with age-related macular degeneration and professionals who work with them. This application allows the professionals to keep tracking of the progress of their patients, in this way they can follow up on the evolution of the macular degeneration and the progress of the exercises that the patient is doing. The application has evaluations, which can be used by professionals to properly monitor the patients. Thanks to them it is established the location of the reference dot of the patient, to help them see correctly, therefore, the app allows a personalised usage. This dot is the place where the patient has to look so that the stain goes to that location, allowing them to see what they want with the peripheric vision. Besides, the app has 17 exercises to help the patient’s visual rehabilitation. These exercises have different categories, from identifying letters and figures to recognizing parts of the face and everyday objects. Said exercises can be recommended by the professional through a personalized analysis using patient’ clinic data. The aid of the project is that the patient, besides being able to exercise with the professional, also may do it on their own tablet from the comfort of their house without losing their follow-up. Giving the opportunity of doing exercises more frequently than the traditional way where the rehabilitation is only made in person.

Full text

Development of an Android application as a personalised visual rehabilitator for patients with Macular Degeneration Desarrollo de una aplicación Android como rehabilitador visual personalizado para pacientes con Degeneración Macular Degree in Computer Science 2021-2022 Faculty of Computer Science Authors: Escobar Suarez, Daniela Alejandra Martín Puebla, Alba María Núñez Conde, María Rodríguez Pereira, Diego Alejandro Supervised by: Guijarro Mata-García, María Recas Piorno, Joaquín Collaborators: González Vides, Leonela González Montero, María Guadalupe II Development of an Android Application as a Personalised Visual Rehabilitator for Patients with Macular Degeneration Desarrollo de una Aplicación Android como Rehabilitador Visual Personalizado para Pacientes con Degeneración Macular Computer Science’s Final Project By: Escobar Suarez, Daniela Alejandra Martín Puebla, Alba María Núñez Conde, María Rodríguez Pereira, Diego Alejandro Supervised by: Guijarro Mata-García, María Recas Piorno, Joaquín Collaborators: González Vides, Leonela González Montero, María Guadalupe Final Project 2021-2022 Faculty of Computer Science Complutense University of Madrid Madrid, 2022 III IV Dedication We dedicate this app to the Macular Degeneration patients. We hope that this project improves their lives. We also want to dedicate this project to all the teachers who have taught us throughout our university education. Finally, to all our loved ones. Acknowledgment We express our deepest gratitude to Leonela González Vides and María Guadalupe González Montero for their support, advisement, and input on the matter. We want to thank María Guijarro Mata-García and Joaquín Recas Piorno for making this project possible. V Abstract The Age-related Macular Degeneration (AMD) is an illness that creates one or more stains in the vision that may affect significantly in the everyday life of whoever suffers it. It is a disease that afflicts mostly to people of advanced age and, nowadays, their treatments are not modernized to the digital era. In the present day, it is mainly tested and exercised through paper, as there is not enough investment to digitalize, which would make easier the treatment of the patient, therefore, make easier the professional work. The objective of this project is to develop an application that helps both patients with age-related macular degeneration and professionals who work with them. This application allows the professionals to keep tracking of the progress of their patients, in this way they can follow up on the evolution of the macular degeneration and the progress of the exercises that the patient is doing. The application has evaluations, which can be used by professionals to properly monitor the patients. Thanks to them it is established the location of the reference dot of the patient, to help them see correctly, therefore, the app allows a personalised usage. This dot is the place where the patient has to look so that the stain goes to that location, allowing them to see what they want with the peripheric vision. Besides, the app has 17 exercises to help the patient’s visual rehabilitation. These exercises have different categories, from identifying letters and figures to recognizing parts of the face and everyday objects. Said exercises can be recommended by the professional through a personalized analysis using patient’ clinic data. The aid of the project is that the patient, besides being able to exercise with the professional, also may do it on their own tablet from the comfort of their house without losing their follow-up. Giving the opportunity of doing exercises more frequently than the traditional way where the rehabilitation is only made in person. Keywords: Macular degeneration, rehabilitator, application, technologies, Android, AMD. Repository access: Drive: https://drive.google.com/file/d/1BMZCqhv4lfnnvFVDEH-m7- uvX_YG9nJo/view?usp=sharing GitHub: https://github.com/DaniEscUCM/VisualRehabilitator.git VI Resumen La Degeneración Macular Asociada a la Edad (DMAE) es una enfermedad que produce una o varias manchas en la visión que puede afectar significativamente en el día a día de las personas que lo padecen. Este trastorno ocular es diagnosticado mayoritariamente a las personas de edad avanzada, y actualmente, los tratamientos no se han actualizado a la era digital. Hoy en día se utilizan principalmente pruebas y ejercicios en papel debido a que no hay suficiente inversión en digitalizarlo, lo cual facilitaría el tratamiento a los pacientes, y por consiguiente, el trabajo de los profesionales. El objetivo de este proyecto es desarrollar una aplicación que ayude tanto a las personas que sufren de la degeneración macular asociada a la edad como a los profesionales de la salud que trabajan con este tipo de pacientes. Esta aplicación permite llevar un seguimiento de los pacientes con los que el profesional trabaja, en el que podrán seguir la evolución de la degeneración macular y el progreso de los ejercicios que va realizando el paciente. La aplicación cuenta con evaluaciones, las cuales pueden ser utilizadas por los profesionales para realizar un seguimiento adecuado de los pacientes. Gracias a esto se puede determinar dónde ubicar el punto de referencia del paciente, el cual es diferente según la persona, para ayudarle a ver correctamente, por lo que la app permite un uso personalizado. Dicho punto indica el lugar donde tiene que fijar la vista para que la mancha quede en esa ubicación, permitiendo así ver su objetivo con la vista periférica. A su vez, la aplicación cuenta con 17 ejercicios para ayudar a los pacientes en su rehabilitación visual. Estos ejercicios son de distintas categorías, desde identificar letras y figuras hasta reconocer partes de una cara y objetos de la vida cotidiana. Dichos ejercicios pueden ser recomendados por el profesional haciendo un análisis personalizado con el uso de los datos clínicos del paciente. La intención del proyecto es que el paciente, además de poder realizar los ejercicios junto con el profesional, también pueda practicar con su tableta personal desde el confort de su casa sin perder seguimiento alguno del progreso y de los resultados. Dando la oportunidad de hacer ejercicios más frecuentemente que por la vía tradicional donde la rehabilitación es efectuada únicamente de manera presencial. Palabras clave Degeneración macular, rehabilitador, aplicación, Android, tecnologías, DMAE. Acceso al repositorio: Drive: https://drive.google.com/file/d/1BMZCqhv4lfnnvFVDEH-m7- uvX_YG9nJo/view?usp=sharing GitHub: https://github.com/DaniEscUCM/VisualRehabilitator.git VII Index Dedication ............................................................................................................... IV Acknowledgment ................................................................................................... IV Abstract ..................................................................................................................... V Resumen .................................................................................................................. VI Figures index ........................................................................................................... IX Chapter 1 – Introduction ....................................................................................... 10 1.1. State of the art ........................................................................................................ 10 1.2. Objective ................................................................................................................ 16 Chapter 2 - Workplan ............................................................................................ 18 2.1 Requirements ........................................................................................................... 18 2.1.1 Requirements for improving usability .............................................................................. 19 2.2 Software modelling ................................................................................................. 19 2.3 Tasks distribution ...................................................................................................... 20 Chapter 3 - App design......................................................................................... 23 3.1 ¿Why Android? ........................................................................................................ 24 3.2 Use Cases ................................................................................................................ 24 3.2.1. Patient ................................................................................................................................ 24 3.2.1.1 Patient Main Menu ..................................................................................................... 25 3.2.2 Professional ......................................................................................................................... 25 3.2.2.1 Professional Main Menu ............................................................................................. 26 3.2.2.2 Professional Patient ..................................................................................................... 26 3.2.2.3 Professional New Patient ............................................................................................ 26 3.2.2.4 Professional Profile ...................................................................................................... 28 3.2.3 Error proofing ...................................................................................................................... 29 3.3 Database ................................................................................................................. 31 3.3.1 Authentication Database ................................................................................................. 31 3.3.2 Real-Time Database .......................................................................................................... 32 Chapter 4 - Patient evaluation ............................................................................. 37 4.1 Drawing Dots in the correct coordinates ............................................................... 37 4.2 Manual input from professional.............................................................................. 38 4.3 First Test .................................................................................................................... 39 4.4 Second Test .............................................................................................................. 40 4.5 Results from the tests ............................................................................................... 40 Chapter 5 - Exercises ............................................................................................. 42 VIII 5.1 First exercise ............................................................................................................ 43 5.2 Second exercise ..................................................................................................... 43 5.3 Third exercise ........................................................................................................... 44 5.4 Fourth exercise ........................................................................................................ 44 5.5 Fifth exercise ............................................................................................................ 44 5.6 Sixth exercise ........................................................................................................... 44 5.7 Seventh exercise ..................................................................................................... 44 5.8 Eighth exercise ........................................................................................................ 45 5.9 Ninth exercise .......................................................................................................... 45 5.10 Tenth exercise ....................................................................................................... 45 5.11 Eleventh exercise .................................................................................................. 45 5.12 Twelfth exercise ..................................................................................................... 46 5.13 Thirteenth exercise ................................................................................................ 46 5.14 Fourteenth exercise .............................................................................................. 47 5.15 Fifteenth exercise .................................................................................................. 47 5.16 Sixteenth exercise ................................................................................................. 47 5.17 Seventeenth exercise ........................................................................................... 48 5.18 Pause ...................................................................................................................... 48 5.19 Focus dot settings .................................................................................................. 49 5.20 Charts information ................................................................................................. 49 Chapter 6 - Results ................................................................................................. 51 6.1 Technologies used .................................................................................................. 52 6.2 API Version Adaptations ......................................................................................... 54 6.3 Screen Size Adaptations ......................................................................................... 55 Chapter 7 - Conclusions ....................................................................................... 57 Chapter 8 - Contributions ...................................................................................... 58 8.1 Daniela Alejandra Escobar Suarez ........................................................................ 58 8.2 Diego Alejandro Rodríguez Pereira ....................................................................... 59 8.3 Alba María Martín Puebla ....................................................................................... 62 8.4 María Núñez Conde ................................................................................................ 64 Bibliography ........................................................................................................... 66 Appendix ................................................................................................................ 69 A. Figures ....................................................................................................................... 69 IX Figures index Figure 1 Central Vision Test: Amsler grid test ................................................................... 11 Figure 2 Eyecare: Amsler grid test ................................................................................... 12 Figure 3 Amsler Grids: Amsler grid test ............................................................................ 13 Figure 4 Verana Vision Test .............................................................................................. 14 Figure 5 MaculaTester ...................................................................................................... 15 Figure 6 Gantt Chart ......................................................................................................... 22 Figure 7 First design ........................................................................................................... 23 Figure 8 Balsamiq design .................................................................................................. 23 Figure 9 App design .......................................................................................................... 24 Figure 10 Material Design recommendations ................................................................ 29 Figure 11 Confirm message ............................................................................................. 30 Figure 12 Unfilled fields ..................................................................................................... 30 Figure 13 Error message.................................................................................................... 30 Figure 14 Error in field ........................................................................................................ 31 Figure 15 Firebase Authentication ................................................................................... 32 Figure 16 Relative coordinates ........................................................................................ 38 Figure 17 Grid example .................................................................................................... 38 Figure 18 Calculated Focus ............................................................................................. 40 Figure 19 Weighted calculated focus............................................................................. 40 Figure 20 Dots setting ........................................................................................................ 49 Figure 21 Exercise chart .................................................................................................... 49 Figure 22 Circle Image View sample .............................................................................. 53 Figure 23 Compatible Android devices .......................................................................... 54 16 vision test, is similar to the Amsler grid, but unlike the other applications discussed above, it is not possible to select which areas the patient is unable to see, because the test only checks if the patient sees any blurry or missing lines, or that the lines appear wavy or bent, so it is only possible to suspect that the patient has a visual difficulty but is unable to do anything else to treat it or to at least tell which parts the patient is unable to see, unlike the other apps that the test could be evaluated by an ophthalmologist. o The application does not support full screen, and it seems that is developed for only phones although in the Play Stores it says that is for all devices, because there was found that the grid layout for almost everything does not reach the total of the screen but only a part of it, and with that, all objects are partially seen. Also, the buttons and the images are small, which makes it difficult to see for even people that do not have any visual difficulties, and with that, there is no description for some of the buttons, which makes it difficult to know what a button does. o Eye Care Plus is mostly focused on exercises, these exercises are for different types of eye problems, there are different categories that they offer, such as exercises for stimulation, lazy eye, dry eye, accommodation spasm, relaxation, and eye muscles. The application offers around 50 exercises at the time of writing, nevertheless, the application does not offer any exercise for macular degeneration. As said before, it can only suggest that a patient has macular degeneration but is unable to determine where could be the patient’s focus point, for this reason, it is not possible to develop any exercise. o Eye Care Plus offers some of the exercises with audio included, so the patient does not have to activate Talkback. o The user is unable to interact in any form with the exercises. They were made to only follow or pursue figures, statics or with movement. o The application offers tracing the patient progress, showing the progress of each day of the week, and trace the progress of each category of exercises. o Eye Care Plus also offers 5 different training plans. Some of them are bedtime training, dry eye training, and lazy eye training. All of the plans are paid, so because of this cost, none of them could be tested. 1.2. Objective General Objective: To develop an application that allows patients with Age-related Macular Degeneration to carry out personalised exercises for improving their sight. Making it possible for Professionals to keep track of their patient’s progress and generating a focus dot that will guide the patients on where to position their eyes while doing the exercises for a faster rehabilitation. 17 Specific Objectives: • Grant professionals and patients access to patient information. With the development of an interface where both users can see graphs of the progress made by the patient in each exercise and see if the patient is improving. • Testing the patient's visual difficulties. An initiation test where the focus dot is calculated, an algorithm takes as input the coordinates of the blind spots and generates a focus dot. • Adapting the focus dot and exercises to the patient • Allow the patient to carry out eye’s exercises. Seventeen different exercises to choose from all of them with an increasing level of difficulty. These exercises have evaluation mechanisms for making progress trackers. 18 Chapter 2 - Workplan This section will explain the steps that were taken to complete the project. These include defining the problem, planning the development to solve the problem and the development itself. 2.1 Requirements The following requirements were given by Leonela González Vides, the optical technician who helped us with this dissertation's optical aspects. Requirements for Tests: • Several initial tests and calibration tests are needed to obtain visual data, all under the supervision of the professional user. • Manual entry of the data by the professional, including personal data and the information on blurry or blank spots. Have the option to undo or start over again. • Test the circular grill for the right eye, left eye and both, showing points to check whether the patient sees it, fixing their sight on a central point. The patient separated from the screen at 10cm. Each finding dot will be on screen for 3 seconds. • With the circular grid, the patient can indicate the areas in which they cannot see, specifying whether it is the right eye, left eye or both. The patient should be 10cm away from the screen. Option to undo or start over again. The test may be repeated • The patient’s focus dot coordinate is calculated and may be changed by the professional during the test. • The test’s circular grid is 10 cm in diameter with horizontal and vertical lines separated by 0,5 cm. • Tests may be repeated to evaluate the patient's performance by the professional in charge. • The records of the tests, results and focus obtained will be saved in the database. • Any test may be skipped if necessary. Requirements for Accounts: • Users will need an account to access the application's functionalities. The authentication will be done by email and a password. If the patient user does not have an email, it will be provided with a username, and they will use that username and a password to log in instead of the email and password. • There are two main types of accounts: Professional and Patient. A Professional account has associated several patients, and a Patient account has just one associated Professional. • A Patient can only be created by a professional, as it is needed to add technical information about the patient’s sight. 19 • The database will save the patient's progress, with the exercises that have been done and if the focus is activated or not. • A Professional has access to the data of his Patients, a Professional can also do exercises, and the statistics will be saved in the Patient that has been previously chosen. • The professional may add or edit their patient's data. Technical Requirements: • Only for tablets with Android operating systems. • There should not be any ads. Requirements for Exercises: • The patient statistics may be displayed using graphics that show successful and unsuccessful results for each exercise. • Exercises vary in difficulty, the first ones being the easiest. • The focus dot is used for helping the patients locate the images. • If the focus dot is activated, it will appear in the exercises to provide visual aid. • Static exercises: Recognise shapes, letters and objects that appear on the screen. 2.1.1 Requirements for improving usability The following requirements were made to improve the usability of the application, for people with low sight to use comfortably. All elements in the app allow screen readers. The macular degeneration patients are not blind; however, they may want or need to activate tools such as talkback to help them with navigation. Also, the design of the patient view has been adapted for those with poor vision by having big and separated buttons, high contrast colours and large fonts. For helping with the use of screen readers technologies such as Talkback, NVDA or JAWS, was used the attribute “content description” in all the elements that were images that did not contain text. This attribute is what is going to be read instead of an image if a talkback is used. Out text sizes are configured using “sp” which stands for scalable pixels[10], this makes it possible for users to change the size of the texts in the settings of their android device. If they have previously configured their tablet to use big letters the app will adapt and will function with bigger size letters. 2.2 Software modelling The Scrum framework was used to develop this Project [11]. This framework aims to create a pattern of actions that will aid in the collaborative development of a project, especially a software project. The primary feature of this framework is that it needs regular submissions that progress over time until the project is completed. 20 This software development methodology is recommended for complex projects with a lack of well-defined tasks, such as this one. This technique was chosen since the tasks required for the project were unknown due to the team's lack of familiarity with technologies such as Android Studio and what responsibilities should be considered. This implementation of Scrum started with the Product Backlog. In this phase, the team was documented in Android Studio [12] and in databases compatible with Android Studio so that there could be made a better planning of the project. Once this was over, the different tasks were distributed. The Product Backlog phase had a duration of 2 months. The following step of the framework was the Sprints, which consist of regular submissions, within an interval of one month. These submissions were shown to the tutors, and feedback was given so that it could be added to the following iteration. In this phase, there were weekly meetings where all the members talked about their progress and helped each other if needed. The last phase of software development process consisted in testing the app on optical technicians that work with the final users and understand their needs, suggestions of changes were given, and they were rapidly implemented and uploaded so that the final users could give us further feedback. In addition, the team planned to create meetings every time that considerable changes in the application were made by any of the members. Before the branch was merged into the develop branch, each member, or at least two of them, inspected the code of the member that introduced the changes. With the inspection, there could be suggestions, recommendations, changes, disapproval, or approval. if the team approved of the changes, the changes were approved, and the specific branch was merged into develop. In this way, it is ensured that all the changes that go through development are functional and work with the rest of the project. 2.3 Tasks distribution For distributing the tasks, the team made use of the service that the tool ClickUp provides [13]. The following states were used to distinguish the tasks: Bugs to fix, To do, To do urgent, On Progress, and Complete. ClickUp has the option to add owners to the different tasks, which was useful, as the owner received an email if another person had changed the task's state. Pair programming was used for complex tasks, arranging meetings of two people and programming simultaneously. At the beginning the main task was the design of the application, done by all the members of the project that included discussions with the professional collaborators. Followed by a learning process and versions adaptations. Then, the tasks were distributed mainly in three teams: database and login (María y Diego), patients’ evaluation (Daniela), and exercises (Alba). However, this teams were flexible, especially in common work areas (such as the database is used in both the evaluations and exercises). 21 Since the beginning to the end of the project, there were monthly meetings with supervisors and professional collaborators to discuss requirements and questions, as seen in the documentation given “Actas.pdf”. Also, it was a constant communication through email. In the Figure 6 Gantt Chart that shows the distribution of the different tasks, as well as the period of time in which they were done, as explained before. The application versions shown to project supervisors and professionals are marked with red lines. 22 Figure 6 Gantt Chart 23 Chapter 3 - App design Leonela González Vides, the optical technician who assisted us with the optical parts of this research, gave us the first design of the app (Figure 7 First design). This first preview of what the app would look like, was made with a PowerPoint, and included a general overview of what buttons were required and how the exercises functioned. From this first prototype, it was decided to use a tablet in horizontal view, because it was needed for the activities to have a certain length that was not realistic with small portable devices. This design was used to create a more detailed and complex one using the Balsamiq wireframing[14] tool (Figure 8 Balsamiq design). This wireframe was used as a reference during the development phase; however, it was not fully adhered to, as shown in Figure 9 App design. Figure 7 First design Figure 8 Balsamiq design 24 Figure 9 App design 3.1 ¿Why Android? It was decided to develop the app on Android devices because they are more common than any other operating system. The data obtained by statcounter [15] shows that mobile devices with Android as the operating system in April 2022 make up 70,52% of the mobile operating system market share, and the percentage of tablets with Android as their operating system in April 2022 was 46,12%. Breaking down the data, the application to be accessible to a wider range of users, it needs to be compatible with Android systems. 3.2 Use Cases This chapter shows the differences between the two types of users. When the app is first initialised the first thing that appears is to answer if the person who uses the app is a Patient or a Professional as depending on these, the menus seen will be different as well as the authentication mechanism. 3.2.1. Patient Patients are supervised by a professional, and they can perform exercises or check their data, test history and exercises statistics. A Patient account can only be created by a professional, and they receive a numeric code to be able to sign up in the application. Because of this, a patient account cannot exist without professional supervision. The password for a Patient is the number given at the moment of registration. If a patient loses this number, he can ask the professional that created his account as he will have this number on his patient’s list. 25 As a patient, you have two options for accessing the app. If it is the first time you enter the app, you must choose to register, where you will have to enter your email. Once you have registered, you can use the regular access which is to log in. 3.2.1.1 Patient Main Menu Follows the general design to improve the usability for people with visual impairments by using big size letters. At the top of the main menu, is the user’s name. Beneath the user’s name, are two main buttons. the first one is “data” to check the personal information, test history, and exercise results. The second button is to access the list of exercises. The menu has a smaller button to log out. The colour selection was important. Most of the activities related to the patient have a distinctive separation between red and blue. If the patient is colour blind or has similar conditions, the colours will be overwritten by the ones chosen in device settings. This option is available in all androids since Android Lollipop[16]. This same menu is also displayed when accessed from the professional menu. The professional has an arrow to go back to their main menu. They can alter, delete, or create a new test in the data window, in addition to seeing the same information as the patient. Following the same idea of big, separated buttons, the exercises menu selection enumerates seventeen exercises that the patient can make on their own or with their professional. Same does the test history and exercises history. The main for the patient registration is big fonts and with less as possible text, maximizing the possibility of independence of the patient. It separates the process by beginning with asking for the numeric code given by the professional. This code, which is also the user password, is asked twice, to avoid mistakes. Then the patient will type their desired username. The signing in is similar to the registration, but only one page asking for the username and password. It will give messages in case of mistakes. 3.2.2 Professional Professionals supervise zero or more Patients. They can see their patient’s information and their statistics as well as perform patient’s exercises This last function was implemented in case a Professional want to practise some exercises with their patient in the clinic. Professionals can add new patients and add the information needed as well as performing the vision test. Once the vision test is done, the app will provide a position for the focus dot, and the professional can change its location. As a Professional, you have two options to start using the app registering if you lack an account or login in. 32 by Google [21]. This Authentication module allows different ways of authenticating to the application, which allows to create methods to authenticate with emailpassword, phone number, Google account, Facebook, Microsoft, GitHub, Apple, Twitter, Yahoo and others. This feature of having multiple ways to authenticate a user may be helpful in the future if the app is accepted by the public and grows in popularity. The only data that is available to developers are: the email that was used by the user when registering, the session provider (email, phone, Google, Facebook, GitHub), the date in which the account was created, the date of the last time that the user had access to the database or used the application, and the user ID, as shown in Figure 15 Firebase Authentication. The user ID attribute generated by the Authentication tool will be used to make connections between the Authentication container and both the Firebase’s Realtime Database and Cloud Storage, allowing to identify which data belongs to a specific user. Also, because of Firebase’s Authentication ID, not only the application can safely store the user's password but also secure Realtime and Cloud Storage databases by creating rules inside the database to restrict the data access to only those users that have logged in prior to the data request. 3.3.2 Real-Time Database The database implemented in the app was built using Firebase “Realtime” Database[22]. The Firebase Realtime Database is a cloud-hosted NoSQL database with different options depending on the user's needs. In this case, it was decided on “Realtime” as it is specialised in synchronising data in real-time. With Firebase Realtime Database, it can be stored all the data in a JSON format, which simplifies the task of adapting the data that is already managed or stored to a specific format. Before implementing the database, all the data collected inside the application was stored in JSON format in a file contained in the phone's internal storage; so, when the time comes to implement the database, the process of adapting to build and store in the database was a fluent task. Thanks to the Realtime database, all the data can be synchronised between devices at a reasonable speed. Thanks to this, when a patient is doing exercises, the professional can watch the process in Realtime. For example, whenever a patient finished an exercise, the professional in charge could see the results in a manner of Figure 15 Firebase Authentication 33 little time. This feature proportionate that a person could change the device and get back all the information that has previously in the other device. This comes in handy when a patient is going to visit a professional. If the patient does not bring with him his tablet, he could use the professional’s devices or any other device that the patient could reach for. One of the most significant advantages of the Realtime database is that it is cloud-based. This is one feature that really helps people that are beginning a big project because, with the cloud-based database, all the data does not have to be stored on a server. This is thanks to the Realtime having an SKD built-in that it is not necessary to build or maintain a server. This is because Realtime is built with Firebase’s Cloud Functions. Cloud Functions helps run back-end code without servers, such as testing and running database changes, registering a user with Authentication, and checking the security rules. The Realtime database, although it seems like it can only work with good internet connections to enable the fast real-time that the product appears to offer, it also has an excellent optimisation for when the user is offline or with no internet. In this project it was used one primary strategy, first, when the data is modified, the changes are stored in the device’s internal storage, to make sure the information is never lost anytime or under any conditions, and later, with the help of this feature, when the device comes online, it can upload all the data with the device’s internal storage, or also with the use of local cache on the device. With this, when the device is with poor connection, or even without connection, the application can still run, store the data secured, and all these without losing any data or features. With the Firebase tool, the data can be secured, using user-based security. Can work together with Firebase’s Authentication tool, to secure all the data stored in the Realtime database, so no one with no proper authentication can access the information. The Real-Time container is used for storing all the information about the patient’s health and improvements, as well as being the connection between a professional and his patients. The data in this database is organised using JSON objects. The database's primary key is “macularehab-default-rtdb”, which contains the value of the other five keys: NumberOfProfessionals, Patient, PatientsNumericCodes, and Professional. NumberOfProfessionals: This key-value pair represents the number of professionals that have made an account on the application. This number starts at 100. Patient: • Key: The authentication number given by Firebase when the patient account is created. • Value: o PatientNumericCode: Is the code for the patient to get access to the application. 34 o ProfessionalUID: is the professional identification number that helps find the professional in charge of the patient. PatientsNumericCodes: Here the numeric codes generated by the professional are stored. It only stores the codes that have been generated and that are not yet used by a patient to create an account. This helps to find if the code introduced by the patient during registration is correct, that this code was undoubtedly generated by a professional, and that it was already not being used by any other patient. Professional: it lists the professional's unique identifier given by the authenticator when creating the account. Here all the information, either professional or patient info is stored. In each of these keys: • name: Given name of the professional • numberOfPatients: this number is used to create the patient’s numeric code, which helps identify the professional’s patients. This field is similar to NumerOfProfessionals and also starts in 100. • ProfessionalNumericCode: is the value obtained from the NumerOfProfessionals value. This value is used to generate the patient’s numeric code. • uid: is the user’s unique identifier generated by the Firebase Authenticator. • contact_info: professional’s contact information. o email_address: professional’s email address. o phone_number: professional’s phone number. • patients: List of professional’s patients. Each patient is identified using the numeric code generated by the professional. o Key: The numeric code. This numeric code is constructed using: The first three numbers are the identification number of the professional. Because of this, each professional’s patient starts with the same three numbers. The following three numbers are made by the number of patients a professional has. The last two numbers are generated randomly. These random numbers were created to reduce the probability of mistaking users' IDs and avoiding using another user's ID. o Values: ▪ tests: list of the test realised to the patient with each key made from the date on which the test took place. Then for each test, there are: the focus calculated when the test was performed and the results of each test with the coordinates that fill the stain listed. ▪ av: patient’s visual acuity. ▪ cv: patient’s visual field. ▪ checkBox: a list of Booleans values of each checkbox filled out in the patient’s form by the professional. Each checkbox is a patient difficulty. ▪ date: the date of when the patient’s data and the account were created. ▪ date_of_birth: patient’s date of birth. ▪ diagnostic: patient's diagnosis, which is most likely to be macular degeneration associated with age, but it could include other diagnoses if the patients suffer from something else. 35 ▪ exercises: • exercisesInfoList: contains a list of exercises. Each exercise has: o times_completed: the number of times an exercise was performed. o resultsList: contains a list of each exercise attempt. Each attempt contains: ▪ counterCorrect: corrects obtained in the exercise. ▪ counterFailed: failed results in the exercise. • exercises_acomplished: the number of exercises that the patient has completed, namely, the number of exercises with more correct results than failed. ▪ focus: contains two values, “first” indicating the x coordinate of the focus dot and “second” indicating the y coordinate of the focus dot. ▪ focusIsOn: indicates if the focus was on or off last time. ▪ focus_size: the size of the focus, is a decimal number between 1 and 2. ▪ gender: indicates masculine, feminine, or not indicated ▪ hasAccount: indicates if the patient created an account. ▪ date_last_test: date of the last performed test. ▪ name: patient’s first name. ▪ first_lastName: patient’s first last name. ▪ second_lastName: patient’s second last name. ▪ observations: comments from the professional about the patient. ▪ patient_numeric_code: numeric id created to identify a patient. ▪ patient_uid: unique authentication id of the patient’s account. This field is generated when a patient account is created, and the number is generated automatically by the Firebase Authentication tool. ▪ patient_username: The patient’s account username or e-mail. This field is also created when a patient registers into the application. ▪ professional_name: patient’s professional name ▪ professional_uid: professional’s authentication id. This id is generated by the Firebase Authentication tool. 3.3 Cloud Storage Last and least, Clouds Storage is mainly used to store larger files which are not always needed and are least important than the primary data of the patients and professionals. Firebase’s Cloud Storage is an object storage service with the capabilities and scale of Google’s Cloud [23]. In this project, Cloud Storage was used to store heavy 36 user-generated data that exceeds the capabilities and functionality of Firebase’s Realtime database that was discussed before. Cloud Storage has the capability of robust operations, where it can perform uploads and downloads of objects regardless of the user’s internet connection and network strength. These robust operations mean that both downloads and uploads can stop if the application loses internet connection and restart the process when the internet is re-established; also, it behaves depending on the network strength, bandwidth and type, saving the users time and cost. Firebase also worries about the security of Cloud Storage. Because of this they integrated Cloud Storage with Firebase Authentication. With Authentication, the project was programmed and declared with the database’s rules, so the data in Cloud Storage can only be accessed with the users that authenticated before. These rules can grow and reach other types of rules, to grant access not only by Authentication but also depending on the filename, the size of the file, the content type, and other types of metadata. In this project, Firebase’s Cloud Storage is used to store the user-generated profile’s photos, because there are larger files, much more than the main data, and are not always accessed. These files are not always accessed or created because it is not required for a professional to upload a pho. Even if a professional uploads a photo to his profile, that photo is not frequently downloaded or needed. In conclusion, the files used are heavier and less critical than the other data managed in the application. For this reason, this data is kept in a different location and not in the Realtime Database. 37 Chapter 4 - Patient evaluation When a Professional adds a new patient, a first evaluation may be solved after indicating personal data. These tests are meant to be under professional supervision. And can only be done from the professional's account. Each test can be skipped if the professional considers it appropriate. There is previous information about the stain that can be uploaded and two different evaluations to determine the blind spot of the patient. Both the upload and the tests are repeated for the left eye, the right eye and both eyes. Each array of coordinates is saved in the database by the date of creation, since the test can be repeated through the sessions to see the progress. The final coordinate to the focus dot is also saved and later used in the exercises. The focus test can be seen in the resume stain in the test’s history. There is a special process for smaller devices. If the tablet is under 10 cm, the tests won’t be able to be taken. However, the manual input from the professional may be filled with a smaller circle that adapts to the screen size. As other activities have layouts to screen sizes under 700dp. 4.1 Drawing Dots in the correct coordinates The circles are drawn using “metric units”, which is the size of each square in the grid. Since objects on the screen are measured in pixels, and it is needed in centimetres, it is used a function of “pixels per inches”, and from that it is transformed. Also, the measure must be a natural number, a pixel cannot be partially used. In a tablet with a width of 10 or more centimetres, the metric unit is half a centimetre, and the size of the circle is calculated as twenty times the metric unit: [24] 𝑚𝑒𝑡𝑟𝑖𝑐 𝑢𝑛𝑖𝑡=[ 𝑝𝑖𝑥𝑒𝑙𝑠 𝑝𝑒𝑟 𝑖𝑛𝑐ℎ𝑒𝑠∗0.19685] 𝑠𝑖𝑧𝑒=𝑚𝑒𝑡𝑟𝑖𝑐 𝑢𝑛𝑖𝑡∗ 20 For devices with a width under 10 centimetres (only the manual input can be filled), the metric unit will be the width of the screen divided by 20, so the size of the circle is the width of the screen. The metric unit is floor rounded so the circle does not go off-screen. The size of the circle is calculated from the metric unit to avoid small variations from round numbers that may dealignment elements in the screen. 𝑚𝑒𝑡𝑟𝑖𝑐 𝑢𝑛𝑖𝑡=⌊𝑠𝑐𝑟𝑒𝑒𝑛 𝑠𝑖𝑧𝑒 𝑖𝑛 𝑝𝑖𝑥𝑒𝑙𝑠 20 ⌋ 𝑠𝑖𝑧𝑒= 𝑚𝑒𝑡𝑟𝑖𝑐 𝑢𝑛𝑖𝑡∗ 20 For all the evaluations there are one or several dots in which the patient's vision is evaluated. Each dot must appear in the spaces between the lines in the grid. Knowing that the circle formula in Cartesian coordinates is 𝑥2+ 𝑦2= 𝑟2 [25] and the grid is seen as a square grid and each space is a coordinate in relation to the centre, then if the previously mentioned coordinates of the square grid are limited by the 38 circle (Figure 17 Grid example), for each (x, y) coordinates and radius r (in this case 10) 𝑥2+ 𝑦2≤ 𝑟2.[26] However, these coordinates would be in the line’s intersections instead of the empty space. So, the positions within the screen are moved half a metric unit to the centre (if the coordinate is negative, it will be by addition, and if the coordinate is positive, it will be by subtraction) and neither x nor y can be zero. The coordinates saved in the database are relative coordinates, with no relation to the screen size or pixels, as shown in Figure 16 Relative coordinates. 𝑥 𝑐𝑜𝑜𝑟𝑑𝑖𝑛𝑎𝑡𝑒=𝑐𝑖𝑟𝑐𝑙𝑒 𝑐𝑒𝑛𝑡𝑟𝑒+ (𝑚𝑒𝑡𝑟𝑖𝑐 𝑢𝑛𝑖𝑡∗ 𝑟𝑒𝑙𝑎𝑡𝑖𝑣𝑒 𝑥 𝑐𝑜𝑜𝑟𝑑𝑖𝑛𝑎𝑡𝑒)±𝑚𝑒𝑡𝑟𝑖𝑐 𝑢𝑛𝑖𝑡 2 Observation: In Android Studio, the coordinates system starts in the top left corner of images, so the coordinates in relation to the centre are opposites to a common Cartesian coordinate system for the y-axes. So, x negative values are on the left and y negative on the top. Same with coordinates from the screen.[27] 4.2 Manual input from professional There are tools that professionals use to measure the blind spot of the Macular Degeneration patient. This information can be uploaded through the grided circle. When the screen is touched, an event is risen giving the coordinates within the screen.[28] These coordinates are compared to possible coordinates in the grid. In the event that the coordinates are within a square in the grid, a dot will appear or disappear. Therefore, each valid coordinate is given a maximum and minimum x coordinate, the same happens with the y coordinate. 𝑥 and 𝑦: coordinates from event. 𝑥𝑚𝑖𝑛 and 𝑥𝑚𝑎𝑥: coordinates limiting valid coordinate in the x-axes to a specific valid point. 𝑦𝑚𝑖𝑛 and 𝑦𝑚𝑎𝑥: coordinates limiting valid coordinates in the y-axes to a specific valid point. 𝑥𝑚𝑖𝑛 ≤𝑥 ≤ 𝑥𝑚𝑎𝑥 and 𝑦𝑚𝑖𝑛 ≤𝑦≤ 𝑦𝑚𝑎𝑥 then the dot related to 𝑥𝑚𝑖𝑛, 𝑥𝑚𝑎𝑥, 𝑦𝑚𝑖𝑛 and 𝑦𝑚𝑎𝑥 is activated or deactivated. Figure 17 Grid example Figure 16 Relative coordinates 39 If the 𝑥 and 𝑦 coordinates do not match with any valid coordinates, then no dots are activated or deactivated. The limiting value for each coordinate is calculated from where the dots are drawn, those are referenced to the centre of the square in the grid. Then the maximums and minimum are added or subtracted by half a metric unit: 𝑥𝑚𝑖𝑛 =𝑥 𝑐𝑜𝑜𝑟𝑑𝑖𝑛𝑎𝑡𝑒−𝑚𝑒𝑡𝑟𝑖𝑐 𝑢𝑛𝑖𝑡 2 𝑥𝑚𝑎𝑥 =𝑥 𝑐𝑜𝑜𝑟𝑑𝑖𝑛𝑎𝑡𝑒 + 𝑚𝑒𝑡𝑟𝑖𝑐 𝑢𝑛𝑖𝑡 2 There is a repeat button to start over with a clear grid. 4.3 First Test Before each test comes an explanation obtained from the professional Leonela González: 1. Press anywhere on the screen when the dot can be seen. This helps the patient to concentrate on the activity without having to find a button to press and may be difficult to see. 2. Cover gently, without pressure, the left, right or non-eyes. 3. Place the screen at 15 cm. 4. Look at the centre dot and do not move the head during the test. The test consists of a central dot that blinks three times then a second dot that also blinks three times. The blinking helps drag the attention back to the centre and to then find the dot. This will happen repeatedly until the second dot appears on all the coordinates. The centre dot is to catch the attention of the patient and the second one is to be found by the patient. The latest dot follows the valid coordinates within the circular grid, from left to right and up to down, the order does not matter. In the end, the test may be repeated. The blinking program uses Java.lang library Timers, it is mainly used with a total time and tick interval [29]. Every 0.5 seconds the dot (either the centre or the finding one) will appear or disappear. Then, after 3 seconds (and after appearing and disappearing three times) it will start a certain action. When the centre dot has finished blinking it will stay visible, the coordinate of the finding dot will change and will start blinking. After finding dot time is up, it will disappear and initiate the centre dot blinking. This occurs unless it is the final dot, in that case the test will end and show the buttons to start over or continue. This test takes between 17 and 28 minutes, depending on how fast the patient finds the dot. 40 4.4 Second Test Identical to the manual input from the professional, the only difference is that it is filled by the patient to indicate distortions in the grid. Before each test it has instructions like the first test, also given by Leonela González (can be seen in document IndicacionesActividadesEvaluacion.pdf): 1. Touch the spaces where it is wavy, blurry, distorted lines, missing or shadowed areas. 2. Cover gently, without pressure, the left, right or non-eyes. 3. Place the screen at 15 cm. Same as the manual input from the professional, the first touch within a valid coordinate activates the dot and a second touch deactivates it. There is a repeat button to start over. This test was originally mended to be done with an Amsler Grid, but to help the data comparison with the first test and the professional input, it was changed to be also in the circular grid with Leonela González approval. 4.5 Results from the tests After a debrief of the result of each test, it is calculated as a general stain, taking common and uncommon dots. The focus dot is obtained by the means of the x and y coordinates, respectively, from all the different tests, then the repeated coordinates weight more. The more a coordinate appears in different tests, the focus dot is moved more closer to that coordinate. The focus dot does not need to be a “valid coordinate”, meaning it can go anywhere within the grided circle. The focus is seen as in Figure 18 Calculated Focus, the blue dot (focus dot) is placed in the middle of the red dots (results from tests), which means that the dots appeared uniformly in several tests in those coordinates. However, if any coordinate appears more often than others, the focus dot will be moved to the more repeated dots, showed in Figure 19 Weighted calculated focus, in which the focus dot is at the intersection of two lines. Same resume coordinates from the tests, different focus dot. Figure 18 Calculated Focus Figure 19 Weighted calculated focus 41 If the professional disagrees with the resulting focus dot, it may be moved wherever the professional considers appropriate (within the circle). The coordinates can be reset to the initial calculated value. 48 this and the next exercise the points are calculated this way because as they are the last exercises, they are the most demanding, and patients that have made it to this far have already practiced enough in the previous exercises and might need a greater challenge. The exercise will finish either when the patient finds all the specified letters or the given time is over. The default time is greater because, as explained before, this exercise is very demanding when it comes to calculating the final score. This exercise does not have any focus dot. Instead, it has two red guiding lines on the top and bottom of each line which cannot be disabled, to fulfil the requirements of the expert Leonela González, the same situation occurs on the next exercise. 5.17 Seventeenth exercise The seventeenth exercise is similar to the sixteenth. The patient must find the same letters, but this time in larger lines. The way of giving feedback is different, instead of changing the colour of the letters, the whole rectangle around the letter changes to a translucid green, so that the user can still see the letter behind it, which keeps black. In total they are 27 correct letters, therefore, the user can have up to 27 correct answers and up to an infinite number of incorrect answers. The distance between letters and the size of the letters is very small, and this exercise contains more text than the sixteenth, making it the most difficult. Besides this, the calculation of correct and incorrect answer is very demanding, as explained on exercise sixteen, so the user has a challenge. To help them with this, the correct buttons are proportionally bigger than the wrong ones to give them an advantage and not make them feel discouraged. 5.18 Pause The pause functionality is implemented in all exercises. It gives the patient the opportunity to stop the exercise and then return to it. All exercises use timers, one way or another. The pause consists in taking the remaining time in the timer and stopping it. The remaining time is collected in every tick of the timer. Then when it is restarted the exercise, a new timer is set with the remaining time. Also, when pause, the menu is displayed which includes the return to the exercise button. In this menu, it is contained a home button to return to the selection of exercises. There is also a settings buttons which sends the user to the settings windows where they may adjust the focus dot. From exercise 14 to 17, there is no focus dot. However, the patient still has access to the pause and setting buttons. 49 5.19 Focus dot settings The focus dot settings may be changed in the patient main menu (from patient or professional home page), in each exercise description and in the pause menu of the exercises. The view is as shown in Figure 20 Dots setting. As the expert Guadalupe González requested, a setting to change dot size was added. The size is between the original size of the unit and the double it. It has a simplified interface of two buttons, one to increase the size and the other to decrease it. Using the same “draw dot” function used to represent the focus dot in the exercises to show the size, as it changes by pressing the buttons. From this function the size is determined and, instead of the database coordinate, it is used as the central coordinate (0,0). Finally, there is the activate/deactivate focus switch. When activated it will appear in the exercises as visual reference as explained before. The setting button icon was taken from Flaticon. 5.20 Charts information The application stores all the information regarding the results of the activities that the patient performs over time in the database. Each time the patient finishes an exercise is saved the number of correct answers and the number of incorrect answers that the patient got. In this project, the data regarding the patient’s results were chosen to be shown by a chart instead of showing a list of each result, as shown in Figure 21 Exercise chart. The reason for this choice of implementations was to improve the data visualisation, speeding the time for the professional to read the patient’s result and facilitating the visualisation for the patients since the patients have more difficulty seeing text. To implement this feature into the application, there was used the Java library MPAndroidChart mentioned in the technology used section. First of all, is filling up the Figure 20 Dots setting Figure 21 Exercise chart 50 data that is retrieved from the database. Then the data is separated into two datasets, the first one is the correct answers and the second one is the wrong answers. Later is to choose the colours of each bar representing the data, and the size of the bars and texts. For the colours, it was decided to follow the Nielsen usability principle [29], where the colours match the already ones that could be seen in the application, blue for correct answers and red for the incorrect ones. This colour distinction is told by a description that specifies the colour representation. With each bar, there is also a number indicating how many there are in the bar, so the user does not have to search what is the number that represents the bar. In addition, at the top of every group of two bars is located a label describing the number of attempts the group is. There is also a maximum number of results that are shown at a time, which was chosen to be five results, so the user is not overloaded with information, but at the same time, the user can navigate through the chart to search for more and older results. Also, the chart allows to zoom in and zoom out, and move horizontally or vertically; all these options were implemented in the case the user is more comfortable with a different size or view, and in this way be unable to see better the chart. 51 Chapter 6 - Results The first version of the application consisted of just the basic structure, user authentication and a straightforward exercise. The purpose of this version was to show the tutors of this project the main menus and the database, so they could check if the implementation was going in the right direction. This version was shown on the 21 of February 2022. The feedback received was positive, and the only suggestion made was to change the exercise because at the beginning of the implementation, a dynamic exercise was made, but these kinds of exercises fall outside the project’s scope (static exercises). The second version was shown to the project tutors and María Guadalupe Gonzalez. The first version was shown on the 24th of March 2022. The changes needed were the following: • Graphs for showing the progress made by the Patient. • Changing the exercise descriptions so that they’re more understandable. • Fixing the translation errors. The third version was shown on the 21st of April 2022. To the tutors, María Guadalupe Gonzalez, and David Peña Quineche. This version had the previous changes implemented and the following new requirements were added: • Fixing layout disarrangements. • Making the app compatible with small tablets. • The manual introduction test should adapt to the screen. • Fixing exercises 16 and 17 so they fit into small tablets. • Fixing the database to make it compatible with old Androids. • Making the app work offline, with the option to upload progress. The project was last tested with optical specialists on the 9th of May. This version had all the suggestions of the last meeting implemented. They gave us a list of recommendations and things that should be changed: • The distance recommended to do the exercises should be said at the beginning of the exercises. • The focus dot should be customisable in size. • The default time for each exercise should be set to 5 seconds. • The instructions to do the exercises should be said out loud automatically. • Make cups of tea appear compulsory at least once in exercise 10. These last changes were all implemented. A new executable was generated and given back to the app testers, they responded with positive feedback and no more suggestions. 52 6.1 Technologies used Android Studio: Android Studio is an Integrated Development Environment (IDE) for building apps in Android’s operating system apps. It was implemented for both the development and testing of the application.[12] Mobile tablets: They were used to get a more realistic view of how the app would look like, as the Android Studio device emulator has a limited number of devices to try the app on. So, to get a better idea of how the app would look, it had to be tested the APK on several devices with different proportions and different APIs. Balsamiq: Balsamiq is a wireframing tool that helped us create a visual structure for the app to use as a guideline during development.[14] Firebase: Firebase is a platform that helps develop applications. Firebase works for Android but also for iOS and Web development. In this project, Firebase was used to build the database, authenticate users and store their data on Google’s cloud server. [19] Gson: Gson is a Java serialization/deserialization library that helps convert Java Objects into their JSON representation and from a JSON string into an equivalent Java Object [32]. In this project, Gson was used to simplify the task of passing objects information in the intents between activities, where the Java Object is converted into a JSON string from the source activity and then the JSON string is converted back into the Java Object in the destination activity. Gson was also used to store and retrieve data from the database, because the database used in this project works with JSON formatted objects. And last it was used to read and write into the files from the device’s internal storage. The library is under the license: http://www.apache.org/licenses/LICENSE-2.0. Lottie: Lottie is a Java library that works with Android, iOS, Web, and Windows to make and show animations in the application[33]. Lottie parses animations made from Adobe After Effects and exports the animation into a JSON and then renders natively the animation on the mobile. In this project, Lottie was used to import free-copyright animations made by the Lottie community from LottiesFiles into the application to make better-suited animations for people with macular degeneration, in order to show more visible effects of the application. LottiesFiles[8] is a web page where anyone can download animations, most of the animations are for free and without copyright, but there is also a marketplace to buy or sell animations. The library is under the license: http://www.apache.org/licenses/LICENSE-2.0. MPAndroidChart: MPAndroidChart is a Java library that works with Android to make and integrate charts into the application [34]. There is also an iOS version of this library called Charts [35]. In this project, the MPAndroidChart library was used to make bar charts to display the patient's exercise results, in order to show a progress history of the patient. The library is under the license: http://www.apache.org/licenses/LICENSE-2.0. Android-Image-Cropper: Android-Image-Cropper is a Java library for Android that helps to crop images selected by the user [36]. With this library, the user could zoom an image, rotate it, select it from multi-source, and customise the shape, limits and style of the image. In this project, Android-Image-Cropper was used to implement the 53 profile activity, where a user can select a photo from the device’s gallery and perform any of the actions mentioned above. The library is under licence: http://www.apache.org/licenses/LICENSE-2.0. CircleImageView: CircleImageView is a Java library for Android to show images with a circle shape from the original bitmap made from libraries like Picasso [37] (that also was used in this project). In this application, CircleImageView was used to show a profile picture with the shape of a circle as show in Figure 22 Circle Image View sample, which is a common shape that is seen in other apps that uses profile’s photos like https://www.linkedin.com. The library is under the license: http://www.apache.org/licenses/LICENSE-2.0. Picasso: Picasso is a Java library for Android for image downloading and caching. Picasso handles imageView recycler and uses minimal memory resources with complex image transformation and automatic memory caching. In this project, it was used to download images from Firebase Cloud Storage [38]. The library is under the license: http://www.apache.org/licenses/LICENSE-2.0. ClickUp: ClickUp is an App that helps organise tasks and keep track of their state[13]. The app provides a collaborative tool for generating tasks, give them priority and assign them to members of the team. GitHub: GitHub is an online tool with version control that uses git [39]. In this project, it was used to host the code, share and work collaboratively with the team to track the changes made in any set of files. Figure 22 Circle Image View sample 54 6.2 API Version Adaptations In this project, it was decided to implement an application that would be available to the most percentage of people possible while maintaining the application functionality. The objective was to make possible that the people that has a low income, who use old tablets and phones, to try the application and give them the opportunity to rehabilitate their sight. For this reason, the app had to go through adaptations to be functional to all the APIs that were intended to be available. The Android minimum API version selected for this project was API 16: Android 4.1 (Jellybean). This API version makes the application be compatible with 100% of the devices available in May 2022. The percentages of the usage of the APIs can be seen in Figure 23 Compatible Android devices. At the same time, the maximum API version tested reached API 33, which is the highest API that could be tested from the virtual devices available in Android Studio. Figure 23 Compatible Android devices The first obstacle was to find libraries that supported this range of APIs. So, every library chosen and used in the application works with every one of the APIs in the range mentioned above. The first library imported was all the Firebase’s tools. In these libraries, it was not until the update to version 30.0.0, that the firebase-core was removed from the dependencies [40]. With that dependency deleted, the Database and all the Firebase related tools can work with all the Android versions available. The second obstacle was that from API 16 to API 18, the OutPutStramWriter Java class does not use StandardCharsets. For this reason, the users using API below 18, when writing data to a file in the device’s internal storage. For example, when saving the patient’s data, the application cannot correctly save the Latin Characters. Because of this, the users with API below 18 would not be able to correctly see Latin characters like ‘ñ’ or letters with accents. Nonetheless, they can use all the functions 55 regarding data storage and with the database, and if their name is written only in English characters, they would never notice it. The third adaptation was made to include the Lottie library. The obstacle was that from API 25, Lottie animations that are imported to the layout are specified in the XML file, but in the APIs below 25, the View has to be created inside of the class that extends AppCompactActivity using the inflate function. Because of this, all the layouts that incorporated a Lottie View had to be moved to the Java class. The fourth obstacle is regarding the language support of the application. The APIs below 23 manage the Locale class and the application's configuration differently. Because of this, all APIs cannot change the language freely. This problem was solved using the device’s default language. For this reason, the users that execute the application in these versions of Android will have the device’s default language and would not be able to change from that. Nonetheless, the app will be totally functional, and if the user changes the device language, the application will change to that language. Last but not least, the fifth adaptation was regarding about the layouts. The first problem was that the layouts for API 16 were having problems correctly showing some of the activities and Views, such as ScrollViews and the Views that were using resources from the drawable folder. This problem was only in API 16, the rest of the versions worked perfectly with all the layouts and Views. To adapt the application to API 16, an XML layout was created exclusively for API 16 for each activity. The second problem was with the button’s colours. The oldest APIs, from the API 16 to API 19, were having problems showing the properly colours of the buttons, where the colours were in purple or in grey instead of their original colour that mas mainly white, red, and blue. The solution to this problem was to change the View attribute “android:backgroudTint” to the attribute “app:backgroudTint” off all the button’s View attributes. In this way, the newest APIs can adapt to the oldest ones, and the button's colours show correctly. 6.3 Screen Size Adaptations Following the intention of making the application of this project to reach as many people as possible, there was made another adaptation. In this case, the intention is to make the app work with different screen sizes, ergo, to make the app work for most devices. To make this possible it was created layouts variants depending on the device’s screen. The project application is primarily targeted towards tablet devices because this type of device provides a larger screen that allows showing bigger and more visible layouts, helping those patients that have visual difficulties. But, at the same time, it was desired to reach most of the capable devices, like bigger phones, smaller tablets, or huge tablets. And because each one has a different screen size, and a different resolution, not all the layouts work with all devices. For this reason, it was necessary to create variants of the same layout, changing the size, the aspect, or the layout of the Views, to make all objects visible and correctly positioned. 56 Two different layouts were made, one for moderate/big tablets and one for smaller devices. Depending on the device’s width, a layout would be chosen. Devices greater than 700dp which are normally tablets will choose the “tablet display”, and smaller devices will choose the “default display”. The differences between these two layouts are the text size and the percentages of the guidelines that were used as a guide for placing each element. The Tablet display has an average font size of 40sp while the default display has an average font size of 20sp. 57 Chapter 7 - Conclusions The existence of an application specialized in macular degeneration, to practice and rehabilitate the vision with exercises, is very significant to patients with this disability, as they can now rehabilitate from the comfort of their own home and with a greater and higher frequency as they might not be able to have appointments with their health professional every day. And with an application like this they will not need to wait to continue with their rehabilitation process. The app was developed in its totality to satisfy the patients necessities to progress in their rehabilitation, with or without their professional supervision. Helping their autonomy and letting the professional in charge be aware of their progress. From the research documented in the “State of Art”, it could be said with certainty that there is no other application that integrates a customisable focus dot, obtained from the evaluations. The focus dot feature helps the patients to progress quickly as they are constantly reminded of where to position their eyes. It is hoped that the focus dot feature, which was firstly used in the project, will be implemented in future visual rehabilitator apps. Another feature that makes the rehabilitator unique is the combination of eye-evaluations with a variety of free exercises. The patient progress tracking is an essential part of their medical appointments because their professional can see the evolution of their patients just checking the application. The patients themselves can see the progress they are making which can encourage them to practice more and improve their sight to the point where they no longer need to use the app. Evaluations made with experts in the matter were highly positive as they think this is a great tool to give to someone with AMD. It was well-received due to the advance made by the automatic calculated focus dot. Also, the exercises were said to be practical and functional. In the matter of compatibility, Android is the most common operating system, and this application works with 100% of the Android devices, as it works with any API equal or greater than 16. The advantage of this extreme compatibility is its inclusivity: it allows people with lacking resources that they cannot afford buying a new tablet to use the application with an old tablet. With the help of this application more patients can be reached. Additionally, they have a better rehabilitation because they can practise doing exercises more frequently, as they do not require an appointment with the professional, also in the comfort of doing it whenever they want and on their personal space. 64 8.4 María Núñez Conde • Database creation and connection with the android studio project: The configuration of a new database with Firebase and the adjustments needed on the project for it to have access to the database. Giving access to the database web page to all the team members for them to drop all data or to get an overview of the data managed. • Database data entry: Deployment of CRUD instructions regarding the Realtime database in which user data is stored. The creation of two java classes: Professional and Patient, for an easy access and a data exchange mechanism. • The study of the IDE Android Studio for a correct implementation of the application and the structure needed for the application to be scalable and easy to understand. • Creation of the first version of user identification: Deploying the first version of user data and password management that was later updated to a google authentication mechanism for better security. • Connection between users: Generating a method of associating patients to professionals, making use of their user ID. • Creation of the base structure of the project: building of the base activities (user page, home, settings) and interaction between them. • Adaptive layout: Making use of an adaptive layout that works with percentages rather than with pixel dimensions to provide a more heterogeneous display on different devices. • Design of an App logo, using Adobe Illustrator. • Implementation of a method to view passwords while they are being written, by adding an eye icon that when clicked shows the password in normal characters. • Creating the patient-sign up form and connecting it to a database with the help of a transfer object named patient. • Synchronizing the professional logging with firebase’s auth technology, for adding security to the app. • Modification of the seventeenth exercise, changing the structure and adding buttons for each letter instead of the old version where the text was all together in one text view. • First prototype of the professional page, where a professional had a list of patients to choose from and analyse their data. • Creating the Activity of settings, this activity allows users to deactivate the focus dot as well as changing the focus dot size. • In the exercise seventeenth and sixteenth, adding an extra activity that shows the letters that need to be clicked in a big size, because the previous version had the letters that needed to be clicked in a small size. This change was a suggestion made in the last stages of testing with users. • Taking notes during each meeting and writing a summary with the main topics discussed, as well as the decisions made. • Doing two versions of each layout, one for displays wider than 700dp and other for displays shorter than 700dp. The main differences between these two 65 layouts were the text size and the percentages of the guidelines that was used as a guide. • Following the recommendations of the final users and adding an activity before the Exercise’s list activity where users are reminded of the distance they should keep between their eyes and the device. • Adding some go back buttons, for an easy navigation as well as implementing the go back methods needed so that the user could not end up in an infinite loop. • Translation of some strings from English to Spanish. As well as adding new strings to the project. • Testing the Database structure, doing requests to the Firebase’s database and trying to introduce unexpected data to see the database reaction and helping with the debugging process. • Testing the Exercises that were done by other members and reporting the bugs found so that they could do the debugging. • Testing the Layouts in different devices, themes, and sizes. Trying on several Android Studio emulators as well as on different devices such as tablets and smartphones. After the testing, correcting all the layout-related bugs encountered. • Adjusting the text sizes for them to fit all devices. • Doing a Gantt chart that shows the timeline that the project followed and the people responsible for each task. • GitHub management. With the interaction of different branches and reverting changes. • Memory drafting, formatting and revision of the parts made by other team members. 66 Bibliography [1] “Central Vision Test - Aplicaciones en Google Play.” https://play.google.com/store/apps/details?id=com.eyeexamtest.centralvisio n&hl=es&gl=US (accessed May 08, 2022). [2] L. Segre, “Amsler Grid: A Test for Macular Degeneration and Other Vision Problems,” All About Vis., Accessed: May 26, 2022. [Online]. Available: https://www.allaboutvision.com/conditions/amsler-grid.htm. [3] “Eyecare- Amsler Grid Eye Test - Aplicaciones en Google Play.” https://play.google.com/store/apps/details?id=com.eyecareapp&hl=es&gl=U S (accessed May 08, 2022). [4] “Amsler Grids en App Store.” https://apps.apple.com/es/app/amslergrids/id982604083 (accessed May 08, 2022). [5] “Verana Vision Test en App Store.” https://apps.apple.com/es/app/veranavision-test/id1507459848 (accessed May 08, 2022). [6] “Home | Maculatester.” https://www.maculatester.com/ (accessed May 08, 2022). [7] “(632) MaculaTester App Demo (English) - YouTube.” https://www.youtube.com/watch?v=1iPMNHVGXHU (accessed May 08, 2022). [8] “Simply Visio - Aplicaciones en Google Play.” https://play.google.com/store/apps/details?id=com.simply.simplyVisio&hl=es& gl=US (accessed May 08, 2022). [9] “Eye Exercises & Training Plans - Apps on Google Play.” https://play.google.com/store/apps/details?id=com.eyeexamtest.eyecareplu s&hl=en_US&gl=US (accessed May 10, 2022). [10] “Diferencias entre PX, DP y SP en Android | OpenWebinars.” https://openwebinars.net/blog/diferencias-entre-px-dp-y-sp-en-android/ (accessed May 10, 2022). [11] “Metodología Scrum: cómo aplicar el método Scrum | APD.” https://www.apd.es/metodologia-scrum-que-es/ (accessed May 11, 2022). [12] “Download Android Studio and SDK tools | Android Developers.” https://developer.android.com/studio?hl=es&gclid=Cj0KCQjwsdiTBhD5ARIsAIp W8CJZoJyieCwkiY_ZYr_Kt6jX8SrMdmjrtejIHC4z2LxkmJOGO_JmbkAaAjzMEALw_ wcB&gclsrc=aw.ds (accessed May 08, 2022). [13] “Download ClickUpTM | Mobile & Desktop App, Chrome, Alexa, Google Home.” https://clickup.com/download?utm_source=google&utm_medium=cpc&utm _campaign=gs_cpc_t3_nnc_brand_trial_all-devices_tis_lp_x_all- departments_alpha_clickup&utm_content=all-countries_kw-target_text_all- industries_clickup-app&utm_term=e_clickup app&gclid=Cj0KCQjwsdiTBhD5ARIsAIpW8CL0RxOsu2mp0eRRxWnC_dzT- czY2lOiXj-28agmQAL4sPFrp6gzg8kaAtirEALw_wcB (accessed May 08, 2022). 67 [14] “Balsamiq Company Info — We’re Good People, and We Care! | Balsamiq.” https://balsamiq.com/company/#map (accessed May 08, 2022). [15] “Tablet Operating System Market Share Worldwide | Statcounter Global Stats.” https://gs.statcounter.com/os-market-share/tablet/worldwide (accessed May 08, 2022). [16] “How to Turn on Color Blind Mode in Android 5.0 | Tom’s Guide.” https://www.tomsguide.com/us/color-blind-mode-android-5.0,news- 20475.html (accessed May 09, 2022). [17] J. Nielsen, Usability Engineering. 1994. [18] “Design - Material Design.” https://material.io/design (accessed May 10, 2022). [19] “Firebase.” https://firebase.google.com/ (accessed May 08, 2022). [20] “Firebase Authentication | Acceso multiplataforma simple y sin costo.” https://firebase.google.com/products/auth?hl=es (accessed May 10, 2022). [21] “Firebase Realtime Database | Firebase Documentation.” https://firebase.google.com/docs/database?hl=es (accessed May 10, 2022). [22] “Firebase Realtime Database | Almacena y sincroniza datos en tiempo real.” https://firebase.google.com/products/realtime-database?hl=es (accessed May 10, 2022). [23] “Cloud Storage para Firebase | Almacena y entrega contenido con facilidad.” https://firebase.google.com/products/storage?hl=es (accessed May 10, 2022). [24] “Inches to cm converter.” https://www.inches-to-cm.com/ (accessed May 06, 2022). [25] “Circle - Wikipedia.” https://en.wikipedia.org/wiki/Circle (accessed May 03, 2022). [26] “Midpoint circle algorithm - Wikipedia.” https://en.wikipedia.org/wiki/Midpoint_circle_algorithm (accessed May 03, 2022). [27] “How do android screen coordinates work? - Stack Overflow.” https://stackoverflow.com/questions/11483345/how-do-android-screen- coordinates-work (accessed May 07, 2022). [28] “MotionEvent | Android Developers.” https://developer.android.com/reference/android/view/MotionEvent (accessed May 07, 2022). [29] “Timer | Android Developers.” https://developer.android.com/reference/java/util/Timer (accessed May 10, 2022). [30] “Los cuatro principios del buen diseño de Donald Norman | | Webnova Diseño Web a Medida.” https://webnova.com.ar/los-cuatro-principios-del-buen- diseno-de-donald-norman/ (accessed May 11, 2022). [31] “MediaPlayer | Android Developers.” https://developer.android.com/reference/android/media/MediaPlayer 68 (accessed May 10, 2022). [32] “google/gson: A Java serialization/deserialization library to convert Java Objects into JSON and back.” https://github.com/google/gson (accessed May 08, 2022). [33] “airbnb/lottie-android: Render After Effects animations natively on Android and iOS, Web, and React Native.” https://github.com/airbnb/lottie-android (accessed May 08, 2022). [34] “PhilJay/MPAndroidChart: A powerful Android chart view / graph view library, supporting linebar- pieradar- bubble- and candlestick charts as well as scaling, panning and animations.” https://github.com/PhilJay/MPAndroidChart (accessed May 08, 2022). [35] “danielgindi/Charts: Beautiful charts for iOS/tvOS/OSX! The Apple side of the crossplatform MPAndroidChart.” https://github.com/danielgindi/Charts (accessed May 08, 2022). [36] “ArthurHub/Android-Image-Cropper: Image Cropping Library for Android, optimized for Camera / Gallery.” https://github.com/ArthurHub/Android- Image-Cropper (accessed May 08, 2022). [37] “hdodenhof/CircleImageView: A circular ImageView for Android.” https://github.com/hdodenhof/CircleImageView (accessed May 08, 2022). [38] “square/picasso: A powerful image downloading and caching library for Android.” https://github.com/square/picasso (accessed May 08, 2022). [39] “GitHub.” https://github.com/ (accessed May 30, 2022). [40] “Firebase Android SDK Release Notes | Firebase Documentation.” https://firebase.google.com/support/release-notes/android#2022-03-24 (accessed May 10, 2022). 69 Appendix A. Figures A. I Second exercise A. II Third exercise A. III Fourth exercise A. VI Seventh exercise A. V Sixth exercise A. IV Fifth exercise 70 A. XII Thirteenth exercise A. XI Twelfth exercise A. IX Tenth exercise A. X Eleventh exercise A. VIII Ninth exercise A. VII Eighth exercise 71 A. XIII Fourteenth exercise A. XIV Fifteenth exercise A. XVI Seventeenth exercise A. XV Sixteenth exercise