VOL 2 . NO 3 e-ISSN : 2549-9904 ISSN : 2549-9610 INTERNATIONAL JOURNAL ON INFORMATICS VISUALIZATION Developing Context Awareness Mobile Application for Blood Donation Dian Pradhana Sugijarto#. Muriati Mukhtar*. Nurhizam Safie*. Riza Sulaiman** # Faculty of Information Science & Technology. Universiti Kebangsaan Malaysia (UKM). Bangi, 43600. Malaysia * Research Center for Software Technology and Management. Universiti Kebangsaan Malaysia (UKM). Bangi, 43600. Malaysia ** Institute Visual Informatic (IVI). Universiti Kebangsaan Malaysia (UKM). Bangi, 43600. Malaysia E-mail: dpsukm@gmail. com, muriati@ukm. my, nurhizam@ukm. my, riza@ukm. AbstractAi The implementation of context awareness in smartphones is getting broader. Through embedded sensors in smartphones, they are able to detect the deviceAos location and communicate through radio frequency. By communicating through Near Field Communication (NFC), smartphones are able to read NFC tags in short distances to understand the context of the information. Developing a mobile application in the context of blood donation will allow the application to assist donors through the process of donation and improves the userAos experience. The blood donation study is conducted at the National Blood Centre (NBC) in Malaysia. In developing the mobile application, the system architecture and development pattern were designed. The system architecture is presented to understand the requirements of implementing the application. The Model-View-Presenter (MVP) pattern was utilized to develop the application to ensure the development followed the standard procedure. The mobile application with the context awareness ability was evaluated through interviews with potential end users and the stakeholders of NBC. The evaluation resulted in positives responses and offered valuable feedbacks. KeywordsAi Context awareness. mobile application. NFC. blood donation INTRODUCTION Smartphones have become an important device for people to carry wherever they go. By 2018, the number of smartphones produced would have reached 2. 53 billion . The reason for the high demand for smartphones is because of its capability to assist users in carrying out their daily tasks. The three patterns reflecting the capabilities of the smartphone are: logistical, relational, and informational . Finding the nearest gas station, browsing for information, performing online transactions and scheduling meetings are among the daily activities where smartphones can assist the users with minimum effort. The capabilities of smartphones in performing the actions are boosted by embedded sensor devices such as Global Positioning System (GPS). Near Field Communication (NFC), accelerometer, gyroscope, and magnetometer . Ae. Smartphones capture surrounding data through these sensors and the applications analyze the data to generate results. using the captured data, the applications can keep the users informed and the deviceAos physical state . The context awareness capability of smartphones have been used and applied in several areas such as mobile learning . , mobile commerce . , and healthcare . This research will apply the context awarenessAo capability in healthcare specifically in the process of blood donation. In Malaysia, the main blood supplier for hospitalsAo usage is the National Blood Centre (NBC) . Through the investigation conducted in NBC, issues were discovered during the blood donation process. The following are examples of some of the issues. When a donor registers in blood donation counter, the registrar will request for the donorAos donation book that contains the donorAos history. If a donor does not bring the book, the registrar will then issue a new one. This situation is common especially when the donation was not planned. NBC also rewards loyal donors by giving prizes through the points collected through the donation but the points can only be monitored by NBC and not the donors. When blood supply is low. SMS are sent to donors to encourage donation. However. SMS has limited number of characters and is bound to the network cost each time it is sent. The issues discovered can be handled more efficiently by utilizing the capability of context awareness in smartphones. This research paper proposes a context awareness mobile application which can assist donors through the process of donation and improve the userAos experience. The mobile application is named Mobile Donation Assistant (MDA). This paper begins with introducing the capability of context awareness in smartphones and issues that occurred during blood donation which can be solved by developing a mobile application for donors. To ensure that the application is developed properly, the system architecture and its development pattern are designed explained in sections II and i. The developed application, being the main result is explained in Section IV. Section V shows the results from evaluation through interviews from prospective users and stakeholders of the NBC. This paper concludes with discussions and future works in these areas. Android is chosen as the mobile application operating system. NFC Internet Wi-Fi Web Service MDA Server GPS DonorAos Smartphone II. SYSTEM ARCHITECTURE Memory To develop the context awareness system, the MDA application is required to communicate with the sensors and other resources. This section discusses the components required in the system architecture and the scenario of communications supported by the architecture. Components in System Architecture Fig. 1 shows the system architecture. The roles of each component are described as follow: A Internet. Internet connection is the backbone of the system communication. A Google server. Google server provides two services are used by the application. Google Place service returns information about a geographic location or prominent point of interest. Google Cloud messaging service allows push messaging for Android devices. A Web service. The web service is developed with the PHP server-side scripting language. The web service locates the database according to the server location and connects to the database. When the web service receives a query, the web server translates it to a java script object notation (JSON). JSON structure can be read by Android as a JSON object . A Server. The server responses to the query and passes it back to the web service. A Database. The database is developed with MySQL and stores all data on blood donation and user data. A NFC tag. There are two kinds of NFC tags. The first NFC tag is placed at the registration counter known as the start tag. The second tag is placed at the bleeding room called the finish tag. The start tag represents the starting process of the donation while finish tag represents the end of a successful donation. Each of the tag contains two data: place of the donation . or example at NBC headquarte. and start or end. A Smartphone. In order to fully utilize the system functions, the donorAos smartphone must be equipped with NFC. GPS. Wi-Fi or 3G connections with ample internal memory space. NFC is required to communicate with the NFC tag. GPS is required to obtain the phoneAos fine location. Wi-Fi or 3G is used to connect to the internet and also to acquire the phoneAos coarse location in case the GPS cannot be used (For example when the phone is inside a buildin. Internal memory is used to store user id and user setting so that the user would not need to sign in every time he launches the application. In order to fit the Google Cloud Messaging Service Google Place Service NBC Database NFC NFC Tag Google Server Fig. 1 System architecture Communication Scenario of the System Architecture The system architecture is designed to match with scenarios of mobile application functionalities. The first scenario is when the mobile application requests, updates or inserts data into the database. The application performs the actions by communicating with the web service. The application sends a HTTP post method to the web service and the web service then translates it to a standard query language (SQL) executable command which will be passed to the server to obtain data from the database. The second scenario happens when the user performs a blood donation. During the beginning and the end of the donation process, the application reads the NFC tag (The phoneAos NFC feature has to be activated to start this featur. When the phone is close enough to the a NFC tag . ithin 4 c. , the phone automatically reads the data and then opens the application. If the application has been opened, the application then reads the content of the data. If the content is detected as a valid tag, the application captures the starting or ending points of the donation process. After the application successfully reads the NFC tag, it will then update the information to the server database. The next scenario is during the process of receiving notifications from the server. During user registration, the application requests for an application identification number with the Google cloud messaging service. After Google server responds with the identification number, the application stores it in the phone memory and in the serverAos database. The identification number is unique for each donorAos phone, and is used to represent the donor himself. When user activates the function of location awareness, the phone registers the donation site locations with Google location service. If the phone enters the areas that have been previously registered to the service, the service triggers the application and the application will notify a user. GPS and 3G or Wi-Fi is used to locate the location of the device from time to time. MODEL VIEW PRESENTER OF MOBILE APPLICATION Then the operating system triggers the application in case the A good mobile application has to be maintainable and well- user chooses to open it. The helper classesAo task is to simplify structured . To accomplish this, the development has to any process that seems complicated. For example. Date follow standard design patterns. The most suitable design Helper helps in conversion of date format used in java to the pattern is the model view presenter (MVP) pattern. The MVP date format used in MySQL. Since this conversion occurred in or other similar pattern provides a separation, which is useful different processes, it is then more efficient to create a helper for modularity, flexibility and testability between different class. The presenter layerAos lower part consists of an activity and layers of application . This section presents the process This application only has one activity which is and explanation of the MVP pattern used by MDA application. MainActivity while the rests are fragments. All the fragments are embedded in MainActivity. This structure is used because Process to Design MVP Pattern The process starts by categorizing the code followed by the of the ability to read the NFC tag. Reading and processing a drawing of the diagram. The first step is to categorize the NFC tag can only be done within an activity. To solve this, all codes into categories suggested as by . Most of the codes fragments must live inside the activity. With this fall under the presenter layer as they control the applicationAos configuration, the phone will still be able read and process the logic and views. Then the codes in the presenter layer are tag regardless of what the user is currently using the phone for. In the real meaning of view layer, a view displays the divided into two categories: adapters and helpers, or activities state during each process controlled by the and fragments. The adapters and helpers are placed on top of However, due to the limitation of the diagram the activities and fragments because they are AocloserAo to the only presents the significant view data which is presented in the model layer. the changes of the state. For The next step is to draw the arrows as they represent which class triggers which other class. The arrows pointing to the example. SubmitButton is the view that determines the state view layers have a slightly different meaning. They represent changes of the registration process. MenuButton determines the views that triggered the class so that the class triggers the the fragment triggered by a user, etc. Fig. 2 shows the MVP pattern of the MDA application. The views placed in the view layer are supposedly all views that existed in the activities or in the fragments. In order IV. MOBILE DONATION ASSISTANT INTERFACES AND to save the space of the model, only the views that caused the FEATURES changes in the presenter layer are shown. The system consists of two main applications: back end and Components in MVP of the Application front end applications respectively. The back end application In the model layer, there are three important components: is a notification manager application which resides on the Google API, web server, and NFC tag. Other components in server side. The only function of this application is to send this layer are the android operating system and model data notification to the front end application. The front end such as donation, campaign item, user detail, and application resides on the donorAos smartphone. The front end announcement item. Google API is used to create the phoneAos application is called the Mobile Donation Assistant (MDA). identification number and for passing notification from the The application has the following features: sign in, server to the MDA application. The web server processes the registration, main menu, making donation, checking donation request from the MDA and for retrieving data from the history, checking announcement, browsing campaign sites and The NFC tag stores the string data representing the notification setting. starting and ending of the blood donation process. The presenter layer consisting of java classes exists in the A. Notification Manager This layer is divided to two parts which are the Notification manager is an application developed for the upper and lower parts. The upper layer is closer to the model NBC to broadcast an announcement to donors. The recipient layer which is why adapter and helper are in the upper parts. can be filtered according to categories of: blood group, rhesus All adapter classes act as bridge communication between and validity days. Validity days are calculated based on the other classes to the data . xisted in model laye. or external donorsAo last donation. The administrator can also modify the For example. GcmAdapter assists the connection and sender of an announcement. Fig. 3 shows the interface of the getting the identification number using Google API. notification manager. GcmIntentService. GcmBroadcastReceiver GcmMessageHandler are similar to the adapter but they assist in receiving incoming notification and passing it to the Android operating system. Fig. 2 Model View Presenter of blood donation assistant application When the administrator sends an announcement, the notification manager runs three operations. The first is to insert the announcement detail to the NBC database. Secondly, the application captures the Google cloud messaging (GCM) identification number of donors according to the filter given by the administrator. Lastly, the application sends the messages and GCM identification numbers to the GCM After that. GCM service automatically broadcasts to the donorsAo devices. Fig. 4 Main menu Making Donation Making donation is a feature of the MDA to start and end the donation by communicating with NFC tags as well as to obtain reward points. Making donation has four interfaces representing the stages of donation: registration, blood group check, doctor check and blood donation. Each of the interfaces is equipped with a list of processes happening at each donation stage and pictures supporting the The other reason for using pictures is to motivate donors to be less anxious as the processes are normal in any Fig. 3 Notification manager blood donation. Motivational messages are also displayed on Sign In the interfaces to motivate donors of their contribution in Sign in is the first feature of the MDA application. If helping to save lives. donors have been registered, which means that the donors Additional instructions are displayed on the first and the have used the application previously, the donors would only last interfaces asking users to put the phone on top of the NFC be required to input their user id and login. When the tags provided. When the phone successfully communicates application is reinstalled on different device, donors can with the tag, the instruction will change to a message that obtain their previous record by providing the user id. All states the successful reading. necessary information is stored in the server database. When the application reads a tag, several processes will The first is validation to ensure that the tag recognizes Registration the NFC tagAos format and a correct NBC tag. Then, the Registration is a feature for donors when they use the application differentiates the content of the tag, whether the application for the first time. The application asks input in tag contains the start or end strings. If the tag contains the start terms of identity number, name, address and gender. The string, the application will insert a donation record to database identity number is the data used to sign in. with a start value of 1. When the tag contains an end string. During registration, three main processes will occur. Firstly, then the application will update the current donation record by the application will search in database to check for duplication changing the end value to 1. of the identification number. If no duplication was found, the application registers the application to the GCM service to obtain the GCM identification number. Lastly, the donorsAo data is stored in the database along with the GCMAos identification number. Main Menu The main menu is the interface where all features of the MDA can be accessed by users. The buttons represents the features, the star image represents reward points collected by donors, blood drop represents the blood group of donors, picture in the middle represents donorsAo profile picture, and remaining days of donation is shown at the bottom. Fig. shows the main menuAos interface. Fig. 5 Making donation interfaces When the start and end values become 1 then the application knows that the donation process has finished and reward points must then be updated. Fig. 5 shows the interfaces of start and end processes of making a donation. Checking Donation History Donors can check their donation history with this feature. The list of donations that have been made is displayed. Each item in the list is equipped with the place of donation, date and the status of donation. If donors have failed to donate on a certain date, a red cross image will appear on the left side. the other hand, if the donors have successfully donated, a green check mark image will appear. Donors can view details of each donation by pressing any of the items in the list. In the detail interface, additional information such as blood amount, blood component and doctorAos note are shown for future reference. The additional information is input by the NBC staff. This means that the information is only available when the NBC has updated them. Fig. 6 shows the interfaces for checking history Fig. 6 Checking history interfaces Checking Announcements Donors can view announcements sent by NBC using this For each announcement, a title, a message and announcement date will be shown. Browsing Campaign Sites This feature allows donors to browse campaign sites held by NBC according to their desired date. The list of campaign sites will appear along with the organizers name and status of the campaign. Status of a campaign site is coloured with red if the campaign has passed and green if the campaign has not yet been carried out. The interface of list of campaign sites is shown in Fig. eft figur. Donors can also view details of each campaign site by choosing the desired campaign site on the list. A detailed campaign site interface is shown in Fig. iddle and right Additional information shown includes location, date and time of campaign sites. The MDA application also provides additional assistances to donors if they are not familiar with the campaign siteAos Donors can view the location on Google map or request Google map to navigate them directly to the location. Fig. 7 Browsing campaign sites interfaces Notification Setting There are two main settings that user can set: reminder and campaign site location awareness. Reminder is used to remind donors when would be the next suitable time for them to give donation again. Users can modify a suitable time for them to receive the notification. Fig. 8 shows the interface of notification setting. The second setting is whether users want to be notified if users are near the current active campaign sites. Near means that the user . hich means the smartphon. is detected to be in certain radius to any campaign sitesAo location. If this setting is activated, a notification will when the user enter the area. There are a series of processes that will occur before the location awareness feature can be activated. Firstly, the application loads the campaign sites' information from database to grab the address of the campaign sites. Then, the addresses are converted into longitude and latitude At times, the addresses provided by NBC are not complete which will result in failure in conversion to If the coordinate conversion succeeds, the coordinates are then registered to Google location service, along with the radius and expiry time. Expiry time indicates the duration of Google location service storing the coordinates. An appropriate expiry time is crucial for users so that the registered coordinates do not conflict with other applications existing in usersAo smartphone. This is because of the restriction from Google of a maximum number of coordinates that can be registered being 100 for each device . Because of this. MDA will apply a 12-hour expiry time. The reason of choosing 12 hours is because campaign sites coordinates are updated every day at 7 am and no campaigns will be active after 7 pm. Fig. 8 Notification setting interface V. EVALUATION OF BLOOD DONATION ASSISTANT APPLICATION The mobile application of MDA is evaluated by interviewing potential users . lood donor. and stakeholders of NBC. Both parties have different points of view and different needs. Therefore, it is essential to obtain feedback from both parties. The number of potential users for respondents was not limited but the interview will stop when it reaches a saturation point. Saturation is reached when the researcher gathers data to the point of diminishing returns, where nothing new is being added . Theoretical saturation, in effect, is the point at which no new insights can be obtained, no new themes identified, and no issues arise regarding a category of data . The main objectives of the interview are to obtain feedback of the functionality usability of the application prototype. acquire the feedback, respondents are requested to perform a series of tasks . ased on the functionalities of the applicatio. After respondents have finished executing each task, the interviewer asks a series of question regarding the task. The feedbacks from the respondents were then recorded. Aside from obtaining the respondentsAo feedback, the behaviour of respondents during the usage of the application was also observed. This observation is important to improve the user interface and overcome any unexpected behaviour. At the end of the interview session, the interviewer asked questions that summarized the response of respondents. The questions cover suggestions for new functions, overall comments regarding the application and whether the respondents would want to use the application if it is available. The results of the three questions helped to determine whether the respondents felt positively about the application or If there was a software bug during the testing, the probable cause would also be recorded. When the bugs are significant enough to disrupt the evaluation, then the application is repaired before the next interview is carried out. Fig. 9 shows the process of obtaining the evaluation. Interview End Users & Client Functionality Findings Usability Behaviour Feedbacks Bugs Categorized According to Functionalities Both stakeholders and potential users responded positively to the application. All users liked the application and they would want to use the application if it is implemented. Only one donor was not sure as the donor has passed the allowable age for donation. The stakeholders also like the application stating that it would be useful if it is implemented. Problems during Evaluation Although positive responses were received, some problems occurred during the evaluation. These were functionality problems and usability issues. The following are some selected issues chosen because of the importance and relevance to the improvement of this application. Loading Speed One of the weaknesses of the application is the dependency on the Internet. Most of the operations in the application required a communication with the server. When there is no Internet connection or when server has a problem, the user is unable to run the application. At the beginning of evaluation, loading speed was considerably slow and at time with no progress. This problem occurred because of the low server bandwidth. This issue has been solved by migrating to the universityAos server. Usability issues on Making Donation Function Making donation is the most complex function for users because it requires active participation from users. Users are required to tap buttons during the donation process and were also required to place the phone on top of the NFC tag. The first issue is with the buttons. On the applicationAos interface, the buttons were not as clear as the pictures and the instructions . efer to Fig. Users tend to focus on the pictures and the instructions rather than the buttons. This issue could be solved if the application provides a guide for first time users. Another way to solve the issue is to change the colour or the placement of the buttons. The second issue is with the instruction to place the phone on top of the NFC tag. None of the respondents have the experience in using the NFC feature. This proves that although NFC technology has been introduced to Android phones since 2010 . , the adoption to real system in Malaysia is still not as widespread . , . Furthermore, there are two different tags that users are required to use with the correct sequence (Start tag then finish ta. This issue can be solved by guiding the user during registration and after donation finishes. Feedbacks and Suggestions Both end users and stakeholders offered good feedbacks and suggestions. The following are some important feedbacks and suggestions: Repaired Findings Conclusions Fig. 9 Process to perform evaluation Evaluation Result of Mobile Application Prototype Three NBCAos workers and nine donors were involved and evaluated the application. NBCAos staffs include the chief of the Information Technology department, a programmer and a blood expert. Most donors have donated between one and ten . The Idea of Replacing Donor Book All respondents from the end users liked the idea of having the mobile application replacing the donorAos book. This is because respondents will always bring their phone but not the donor book. Most of the respondents seldom brought their donorAos book to the donation site. However, this idea received different responses from NBC. According to the stakeholders from NBC, using the mobile application as the donorAos book is not merely moving donation history from donor book to the application. The donorAos book has been approved by the Malaysian Ministry of Health (MOH). Therefore, the book can be used as legal evidence that the donors have donated. In other words, the mobile application would need to obtain approval before the NBC can declare that it can replace the donorAos book. This issue will be more challenging as not all donors will have NFC-equipped This issue however, can be solved through different Firstly, the NBC can implement an official mobile application which can then be proposed to MOH for Secondly, the NBC can release the mobile application without announcing that the application replaces the donorAos book. When this is installed by many donors who would have used and enjoyed the advantage of the application, there is a stronger case for the NBC to propose for the . Suggestion to Add Additional Information Many respondents suggested that more information regarding blood donation or health knowledge to be included. Information that respondents suggested include: donation reward points, donorsAo donation report, help page, etc. The mobile application prototype can show the reward points and donation history. However, the respondents wanted more detailed information such as the services that donors are eligible to redeem with the collected reward points, information about donation screening status, diseases detected in donorsAo blood, etc. The suggestions to add more information can be interpreted in different ways. Firstly, although monetary payment is not suitable as reward . , providing donorsAo health information can motivate donors to donate. This was discovered by Bart et . that one of the obstacles for users to enroll blood donation is when they do not get any medical advice. lack of knowledge and experience of donors using the technology hindered the true potential of this application. The other drawback of the NFC communication in this mobile application development is security. Encryption and decryption were not implemented during the reading of NFC This enables the NFC tags to be read by any NFC reader. The other important lesson received from the NBC stakeholders is the aspect of legality of information. Developing a mobile application will not merely be on fascinating features with latest technology, but must involve legal considerations. Replacing the donorAos book with the application is not merely transferring information from nondigital to database but it requires the approval and acknowledgement from MOH. This is a similar situation that occurred to Grab and Uber where legality took high priority before the mobile applications can be used . ACKNOWLEDGMENT We express our gratitude to NBC, which has permitted to conduct the case study and facilitated the data gathering. REFERENCES