This week I was partially successful in completing my feature that will have a function that writes to firebase, another one that reads that data written over to firebase, and finally a function that takes that read data and displays it in the home screen of the application. The part that I was successful in completing is getting a function that writes over to firebase. The function took a lot of trial and error but I found a separate solution that looked simpler than mine and was able to implement it in a way that would work with the stuff I had. This solution just had me temporarily store the variables that I needed to get from the WorkoutInterface and then just push that information over to firebase after converting all the of the to strings using the .toString() function. This worked a lot better than my original method of doing this, having the program create new users and then have a separate userId for everyone and just overall creating a bunch of variables that in the end I did not need, I also have prepared a function that will take the data that is read from firebase and have that information shown on the main screen. In addition, I had to create a data class simply to store the information of the workout as each workout is going to be treated as an object.
The final thing that I need to work and that I am confident that I will get done early this week is getting the program to read from firebase. After that is set up the I just have to have the function that displays the data from firebase utilize the function that reads from firebase and everything should go well. I struggled mostly with the writing function and that is because I was just creating a bunch of variables and things that I ultimately did not need. The process in my original method was overcomplicated and it had a lot of code that did not make sense. I also did not make things easy for myself when I first started this project as some of the edit text boxes in WorkoutActivity are not the same kind of edit text boxes so I had to come up with a solution for that as well, If I had to choose a different way to approach this project it would be to lay everything out consistently, meaning use the same way of laying this out for things that are similar, writing comments that explain new things that are added so you can keep track of what is doing what and if I go back and have an issue I can pin point easier where the issue is, and finally I would deal with everything in fragments. From the beginning we were creating new classes for the different layout files but that is completely unnecessary. I would strictly use the classes for things that I want to be objects and then have all the layouts dealt in fragments and any functionality dealt with in the mainActivity.
Moving forward I will complete my goal of having the homepage display the information read from firebase and then I will also try to make my pages a little more appealing for viewers. So far I've been very focused on the functionality of things that I have forgotten that we do need to keep the aesthetics in mind as people often want apps that are nice to look at. Honestly I think lots of people go for the apps that just look the best rather than the one that does the job the best. It's only nice when those 2 things are met by the same application.
Did you like this post? Tell us
Leave a comment
Log in with your itch.io account to leave a comment.