The use of a smart application to track activities for achieving an active and healthy life Suela Maxhelaku Astrit Veliu Alda Kika Silvana Greca Computer Science Dept. Computer Science Dept. Computer Science Dept. Computer Science Dept. suela.maxhelaku@fshn.edu.al astrit.veliu@fshnstudent.info alda.kika@fshn.edu.al silvana.greca@fshn.edu.al Abstract Inactivity is a phenomenon that is these devices [Rad16]. Given the high prevalence of recently characterizing the world and physical inactivity, it is necessary to develop new cost- it is one of the main causes of chronic effective, scalable approaches to increase physical diseases. Health and lifestyle problems activity. One promising direction is the use of are increasingly seeking solutions that smartphones in the delivery and personalization of have technology as the main solution. programs that motivate individuals to increase their In this paper we will analyze various physical activity [Zho18]. algorithms and technologies that can In the current age of technology, smartphones due to be used to accomplish it and how to their ubiquitous nature are commonly used as a combine them to achieve a more medium for promoting physical activities. But people active and healthy lifestyle. This paper still rely less on gadgets, mobiles phones, and other proposes an Android mobile phone specialized devices to track a health indicator. This is application that gives information how in contrast to the fact that recently there has been an active are people during the day, how increase in the healthcare-related research and can we improve their life and unprecedented growth in the systems, devices, and implement a program with activity applications for healthcare management, be it on a tracker. In the focus of the work are personal or a larger scale. So what is the reason that different age groups of people, where despite the availability of plethora of mobile phone this technology will be implementated. applications and devices, half of the people still track Also, will be simulated an application their health status in their head? This is due to the fact which will enable statistics on the that people mostly lack the motivation for performing activities that the user has performed the physical activities. Users use these applications and and various activities that he can ultimately lose their interest after using it for a few accomplish through it. times only. Thus, creating the eagerness of living a healthy life by engaging users is a goal that is more Keywords: challenging and demands more effort [Sar15]. This app will track activities that will be very useful E-Health, Interactive Application, Physical information on daily activities for the user, the amount Activities, Activity Tracker of liquid consumed and what is appropriate according to body mass and gender. The application will also 1 Introduction include the possibility of digitizing the health card, Today, the mobile phone industry is one of the where every person can have his personal data always fastest and most dynamic business sector. The need to with him without the need to keep the card. The app communicate efficiently and instantaneously is always will include a menu of foods and other useful services a necessity. The market sector and the ever-growing such as personal agenda where the user can add notes and demanding consumers always want to have more or memos use light in the dark, access and play music. and they want it better than ever. Having a mobile The application language will be simpler and will be phone for us makes life easier [Jem15]. available to all people for download on smart Android The number of smartphones are growing steadily in phones in the Play Store app. The objective of the app is to promote physical activities and enable users to recent years, especially because they have become achieve their activeness goal. more accessible and more useful in everyday life. It is almost impossible to imagine life without the help of 2 Literature overview level of hydration or Fitbit application that track First, there was no requirement for additional activity and help improve the lifestyle but they need equipment such as pedometers or foot pods and no Internet access to get the data. need for data entry. This makes the app more attractive Also, the Android platform offers several sensors that to those who are ambivalent about the benefits of allow the device to monitor the movement. Possible measurement or about their ability to become fitter and sensor architectures vary by sensor type: width, linear healthier [Con06]. Secondly, while most other apps acceleration, rotation vector, movement, step impact, only activate when users provide notice that they are and step detector sensors. about to begin an exercise event, this app measured 3 Modeling the solution activity continually and without the need for any user 3.1 Functional Requirements action. This feature of the app was intended to reduce the initial investment of time and effort, increase The functional requirements of the systems will be: participation and reduce the dropout rate. In addition, it The users must create a personal profile through a ensured that the app measured the physical activity registration form, must perform activity and can save inherent in routine, everyday activities, as well as more calories burned in the steps taken, must record the purposeful exercise [Harr16]. Another research amount of liquids he consumes and have a graphical suggests an easy way to implement and battery friendly view of the progress, must record consuming foods and method to Step Counting problem, which is based on have a graphical view of progress, can create notes or Android smartphone accelerometer, Fast Fourier memos, plays the music he has on the device within the Transform (FFT) and thresholding. The method, after application, can activate the flashlight of the device (if applied preprocessing and FFT to the data gathered any) from the application, adds data to the database and from smartphone's accelerometer (16hz), detects and has full control over them, has weekly statistics for counts steps by comparing the data to predefined each activity, has the possibilities to share the statistics. thresholds. The predefined thresholds were specified Also, the system will not allow the user to open the by analyzing the accelerometer data obtained while gifts when there are insufficient scores and when the users were sitting, standing, and walking. User daily goal is reached the user is notified via a message experiments were conducted to test the method. Results from the system. showed 87.52% success for walking. Additionally, for sitting and standing the method had a success over 3.2 Data modeling and application architecture 99%, as expected. And for running, only 41.7% of the Since we will not use the client-server architecture for steps were correctly counted [Dir17]. remote data storage, we will use SQLite for storing Another method is gyroscope. Gyroscope is used to them in the application memory. To further enhance measure the angular velocity and accelerometer is used data security and manage them we will use content to measure the acceleration. Both sensors are suitable providers. Mobile app design architecture usually for motion analysis and step counting but consists of multiple layers within an app, which accelerometer is more popular since its ability detect includes the following layers: motion and the rate of change in motion speed [Lin15]. 1. Presentation Layer - This layer consists of components like UI components and UI process. Almost all existing pedometer techniques use The focus is how the application will be presented to accelerometer data to identify steps, which is not very the end user. accurate at low walking speeds. Another research also describes a gyroscope-based pedometer algorithm 2. Business Layer - This layer is formed by business implemented in a smartphone. The smartphone is entities, workflows, and business components. placed in the pocket of the trouser, which is a usual 3. Data Layer - This layer meets the application carrying position of the mobile phone. The gyroscope requirements and facilitates secure data transactions. sensor data is used for the identification of steps. The All the data are within this layer. The system algorithm was designed to demand minimal receives as numerical input data from the computational resources so that it can be easily accelerometer sensor, which are executed in the implemented in an embedded platform [Jay13]. background and provide commands to perform the Also, there are a lot of applications like Water Drink activity calculation that the user is performing. This Reminder by Leap Fitness Group that analyses the layer processes the data and then displays a scheme of all activities is presented in the figure below notification if the conditions are meet. Also, the to create a better idea of the user interface. result obtained by the Barcode with other data taken from the camera are processed to generate the health card and the user profile picture. 3 Application Development 3.1 Technologies used The software model chosen for the application is the incremental model. This choice was made because the application will be put into operation as soon as possible, in order to be presented to the users and to receive an evaluation from them [Bas12]. Through our assessment, we will be able to add or change application functionalities, bringing them closer to their needs. Also, the cost of the incremental process is lower compared to other alternatives. Development of application uses the Android Studio program and Java programming language. The interfaces are encoded through the XML language, also a part of them are programmed in Java. The other technologies on which the app is based are: • Content Providers - manage activity data and Figure 1: Activity and flow chart database. • Shared Preferences - Preserve user's personal The above chart shows the link between activities and information. how we can move in the app. The main interface is • EventBus - a service that enables communication MainMenuActivity, from which we can open three between activities. components. FragmentActivity displays daily data and • BroadcastReceivers - stand all the time on standby can start a new activity. FragmentWater & Food lists to display messages to users at certain time intervals. all drinks and foods and it is sufficient to choose one to • Accelerometer Sensor - generates data for register on a database, and the daily hydration progress measuring user activity. is also visually presented. FragmentToolkit keeps the • Barcode Scanner - scanner for health card. tools and services that offer application. The user can • Adobe Photoshop CS6 - Adobe's software program use device light, play music, and manage notes or through which are processed icons and other application graphics. personal memos. From the side menu, we can navigate • Android Services - serve to perform activities in to the profile where a summary of activities and the background. personal data are presented. The user has the ability to update personal data in the EditProfile activity. • AsyncTasks - Increases application performance EditHealthCard activity provides a form where a health by performing background calculation. card is scanned and other personal card data that are 3.2 Interface reflected in HealthCard activity are scanned. Then we The user interface is a key element when creating an have GiftsActivity where we list the gifts with the application. Its wrong design can lead to project relevant details where the user has the possibility to failure. It is the only contact point the user has with the click on them to open them and go to ViewActivity to app and through it accomplish a certain task. The browse the information. SettingsActivity offers a Android interface is provided by Layout components, functionality that few applications offer. There the user which are programmable in XML and can be located in has the ability to determine the sensitivity of the step the widgets. The application development is based on measurement sensor and change the size of the step. the Model View Controller (MVC) model where an For statistics generation we go to StatisticsActivity and interface is an xml file separated from the logical through the graphs we have a reflection of the weekly model that implements business logic [Sok14]. A performance and we can share the activity with others. Finally, InstructionsActivity and AboutUSActivity have information on how to use the application and how to contact the developer. 3.3 Activity Measurer The application does not need to be connected to the Internet. Any of its activity is performed offline, and data exists as long as the application stays installed on the device. In interface design, the elements are position in such a way to provide more information at the same time such as the current date and the number of steps performed. At the center of the page we have the actual progress of the activity presented with a circular progress indicator which has the amount of kcal burned. It is the presentation of the main activity such as data, time interval, burnt kcal and speed of movement. At the bottom of the layout there are two buttons whose role is the management of the activity. By clicking the start button, the application initializes the step meter service that relies on the accelerometer sensor and saves the number of steps. Figure 3: Water and food information The figure above shows a visual representation of the current hydration level and the image that appears is according to the gender of the user. The information that is displayed in this layout is the daily intent and how it is currently implemented. In the center of the layout, there is a circular button with the + icon. Clicking it will show the drinks menu and we can choose what we are consuming. At the bottom of the page that are the foods which are automatically added to the database. 3.5 Tools - Toolkit Providing extra tools within the application is an added value to the user because he does not need to download other applications but use a single one. Figure 2: Activity Measurer 3.3 Hydration and food recorder Water & Food is a design where the user can choose and record foods and drinks consumed during the day. Figure 3 shows the layout interface. Figure 5: Health Card Figure 4: Tools 3.7 Score system and gifts In the above interface, we have a list of all notes and Some of the application's activities offer you the memos. It is built in such a way that the user feels chance to win points. By doing this, the motivation and familiar with the icons and manages all the tools within interest of the user to use the application increases. At the same interface. Here we can add a new memo or the same time, it helps to achieve the goal of making a note. Each of them can be modified and deleted. At the healthier lifestyle. same time, the activity is added to the database and The activities that are part of the score system are: checked whether it is a memo or not. 1. Doing activities 3.6 Health Card The application offers the possibility of digitizing the 2. Liquid consumption health card, so every person can have his personal data 3. Food consumption without the need to keep the physical card. The design If the user manages to meet the daily goal, he earns 100 of Health Card is very simple and practical. It includes points. With the points he can unlock the gifts a digitized health card presentation with the user's contained in the application and to make their own. picture, the barcode that is associated with the physical Points are estimated based on their health significance. card and other general data like blood group, patient code and emergency contacts. Barcode is identical to the one found on the card and everyone can scan it through any barcode reader device and return the same code. If the user has specified emergency contacts when registering the card, when one of them clicks, the Android application automatically opens with the duplicate call number. By contrast, the buttons are inactive and cannot be clicked. The profile picture is stored in Shared Preferences, so it does not match the other system data. the application, and supporting a wide range of smartphones. We conclude that conducting activities, driven by mobile apps, is a very effective way to improve lifestyle, all at no additional cost. Implementing motivational techniques, including awards, gifts, and motivational announcements, enhances user confidence and encourages them to use more the application and to meet daily activity goals. This application meets all the conditions to be a true track record of activities for achieving a healthier lifestyle in our country. In the future, we expect the development of this application for the iOS platform, performance optimization and the addition of other services needed for the user. In the future, we will work in developing web services to integrate digital card, user personal informations and other services in our system that has in focus managing data and images in E-Health. References [Bas12] Y. Bassil. A Simulation Model for the Waterfall Software Development Life Cycle. International Journal of Engineering & Technology, 2(5), 2012. [Con06] S. Consolvo, K. Everitt, I. Smith, JA. Landay. Figure 6: Gifts Interface Design requirements for technologies that encourage physical activity. SIGCHI 4 Conclusions Conference on Human Factors in Computing In this work, we have analyzed and explored the best Systems. New York: ACM; 457–66, 2006. methods for tracing user activity. This application is for [Dir17] A. Cengizhan Dirican, S. Aksoy. Step everyone and fulfills all the needs, promotes activity Counting Using Smartphone Accelerometer and registers the liquids or foods, reminds them and and Fast Fourier Transform. Innovations on motivates them by gifts. The application has been Intelligents Systems and Applications developed in a way to have a usable user interface, but Symposium, 8(2): 175-182, 2017. at the same time the user achieves the goals he has set [Harr16] T.Harries, P.Eslambolchilar, R. Retttie, Ch. himself. Also, in this application is implemented a step Stride, S. Walton, H. C. van Woerden. BMC meter, which through the accelerometer sensor Public Health, 16(1): 925, September 2016. measures all the steps that the user performs and calculates the burned kcal, the steps he has taken and [Jay15] S. Jayalath, N. Abhayasinghe, I. Murray. A the speed of the movement. In carrying out activities Gyroscope Based Accurate Pedometer such as activity, hydration, or food, users can earn Algorithm. International Conference on points to unlock the gifts that are hidden in the Indoor Positioning and Indoor Navigation, application. This technique is implemented to increase October 2013. user interest and as a motivation to influence the use of [Jem15] G. Jemilda, R. Bala Krishnan, J. Bengtson. the application. During the development, technical Mobile Application for College Bus Tracking. problems have been encountered in realizing high International Journal of Computer Science precision algorithms for measuring activity, optimizing and Mobile Computing, 4 (3): 500–507, March 2015. [Lin15] J. Lin, L.Chan, H. Yan. A Decision Tree Based Pedometer and Its Implementation on the Android Platform. Third International Conference on Signal, Image Processing and Pattern Recognition, 2015. [Sar15] A.Sarwar, H.Mukhtar, M. Maqbool, S.Belaid. SmartFit: A Step Count Based Mobile Application for Engagement in Physical Activities. International Journal of Advanced Computer Science and Applications, 6(8): 271-278, 2015. [Sok14] K.Sokolova, M.Lemercier, L. Garcia. Towards High Quality Mobile Applications: Android Passive MVC Architecture. International Journal on Advances in Software, 7(1-2), 2014. [Tur17] GM. Turner-McGrievy, S. Wilcox, A. Boutté, BE. Hutto, C. Singletary, ER. Muth, AW. Hoover. The Dietary Intervention to Enhance Tracking with mobile (DIET Mobile) study: A six-month randomized weight loss trial. Spring, 25(8): 1336-1342, December 2017. [Zho18] M. Zhou, Y. Mintz, Y. Fukuoka, K. Goldberg, E. Flower, P. Kaminsky, A.Castillejo, A. Aswani. Personalizing Mobile Fitness Apps using Reinforcement Learning. NRA-CSIT- Application on Nosql database: Classification, Characteristics and Comparison, 268, March 2018.