Notifications Reprise

Written By: Quincy Williams

This week, I was able to bring my attention back to exercise notifications for our application. We decided that the notifications were good but we wanted to take them a step further by having them be more intuitive and not as harassing by adjusting the notifications to go off based on the day of the week and if that day of the week matched a day that was in a current routine that was yet to be completed.

Initially, the notifications were more generic and based off of the day of the week, so it would fire everyday except for Saturday and Sunday. This may have been seen as intrusive by the user and it was decided that adjusting the logic would make that feature more useful and not be instantaneously disabled by the user.

To fix this, I needed to find a way to get the routines, and narrow down the routines to just their days and have the app check the current day, from the system time, and compare it to the days that the user set that they would like to do the routine. This required me to create multiple array lists to help narrow down the data and then once it was narrowed down, placed the data that was parsed from the array list, as a string array object, into another string array object. The issue that I was running into with this was finding an efficient way to get rid of some of the data I didn't need from the string array object so it could just been seen as a string. To resolve that, I used the replaceAll method, to have the brackets removed from the string and then had what was left stored as a single string.

Once the data was stored into a string, I was able to split the data into a new string array object which would then be used to loop through and compare each day to the current system day. This required the use of a custom function to get the string out of the string array object properly. With the values customized in the java class to just the first three letters of the day, I had to use a SimpleDateFormat object to make sure the application made the current system day only the first three characters, so we would be comparing strings correctly.



Comments