Jared's Cloud to-do app

Components: Cloud Variable / DIY Extended Listviewer / Recursive Functions / Dynamic Labels / RealtimeDB Authentication

Hey Thunkers!I have wanting to use firebase for a while to store and retrieve lists of variables. quickly. but parsing all the text is resource consuming, takes a bunch of blocks, and is tricky. I considered the cloud vairables for some time now but couldn’t wrap my head around how to use private user keys. I have figured it out and want to share with everyone here.

In my example, you switch between keys within the single cloud variable. to showcase this use, i have two lists of numbers held in 2 different keys of the same cloud variable. each button will count in 1 position of either key. it works for my purposes. I hope it helps you!

in my main project, I could see using this method to store data in the cloud for the purpose of allowing parents or classroom staff to track the same data at the same time for the same student/child across devices. I think this swill allow me to accomplish that task! I would insert the uuserID from Firebase with a ‘/’ and into the key

screen - cloud counting (inside navigator)
https://x.thunkable.com/copy/c8785589c19b2c7b5cf08c96b393aaab
first, I initialize the lists within the cloud variable

next, I set up a listener to wait for changes and make them as needed. notice the logic I used. this will be to keep unnecessary updates occurring to the UI. if you don’t need to set the text, don’t do it. there will be no changes, but the code doesn’t know that so it will ‘redraw’ the same stuff. to the user, there will be no change besides unnecessary slowdowns.

Screen Shot 2020-03-06 at 10.52.32 PM

last i have my counter. study it and you will understand! in the block editor thiese are connected, with the top picture being the blocks on the left, bottom are connected to the right side of the top.

5 Likes

This is awesome, thanks @jared. Should we move it to #thunkable-cross-tutorials though?

2 Likes

Good ideas! This should now be located in the #thunkable-cross-tutorials section :palms_up_together:

3 Likes

UPDATE: this latest iteration includes a dynamic list viewer and private user keys for three lists held within 1 cloud variable.

Check it out. Still in progress

https://x.thunkable.com/copy/850add3e99928579ad53e808f5ac4cba

https://x.thunkable.com/copy/e90b2cc84b663900e9a5b9ab182e50de

UPDATE 2: I replaced the 2 ‘count by’ blocks with recursive functions and this sped up the creation and population of cloned rows and dynamic text.

I added a timer to show how long this takes. I think part of the delay is the clone block itself. Some of the delays are derived from the delay between phone and the realtimeDB.

Check them out!

Screen Shot 2020-03-12 at 9.40.54 PM

1 Like