The Deed Is Done! 83 of 100 Days of…
I finished the last Activity of the Salesman’s Travel app!
You can find a video of this at the bottom of the page and a link to the source code here.
I finished updating the Search Activity. It now populates the ArrayList of addresses using data from the Realtime Database instead.
I added code for configuring the ArrayList containing the addresses, and displaying them using a ListView. The fun part was instantiating the Home objects like I did in a previous version of the app.
In the overridden onChildAdded method for the ChildEventListener, I initialized a String variable containing an element from the Realtime Database. I then instantiated a Home object using this String as the argument and added it to an ArrayAdapter. The ArrayAdapter would be used to configure the ArrayList.
It appears whatever is contained in the onChildAdded method will run iteratively for each element of the Realtime Database (click below).
In other words, with these changes, every element of the database is used to create an object which will be displayed in the app.
I’ve come a long way with this application. It started out as a Java coding challenge turned Android app. It’s not perfect, but it works as intended.
I learned a ton of new skills during my time with this project, and I have ideas for improvements. But it’s time to start something new. If anything, I can revisit this app at a later date.
Join the mailing list to see updates like this every week!
Coding Fanatic
Checkmark Image by PublicDomainPictures from Pixabay