I am trying to build a Quotes app using Firebase Database and Kodular.
My Firebase structure looks like this:
{
“Categories”: {
“Motivation”: {
“image”: “https://example.com/motivation.jpg”,
“data”: {
“1”: “Believe in yourself and all that you are.”,
“2”: “Dream big and dare to fail.”,
“3”: “Success is not final, failure is not fatal.”
}
},
“Love”: {
“image”: “https://example.com/love.jpg”,
“data”: {
“1”: “Love is not what you say, love is what you do.”,
“2”: “In true love, there is no ending.”,
“3”: “You are my today and all of my tomorrows.”
}
},
“Friendship”: {
“image”: “https://example.com/friendship.jpg”,
“data”: {
“1”: “Friendship is the golden thread that ties the heart of all the world.”,
“2”: “A real friend is one who walks in when the rest of the world walks out.”,
“3”: “Good friends are like stars, you don’t always see them but you know they’re always there.”
}
}
}
}
What I want to achieve in my app:
On the Home screen → Display all Categories in CardView (with Category name + Image).
When a user clicks on a Category → Load the related Quotes (data list) into another screen/list.
Quotes should display properly with text items coming from the data node of that Category.
My Question:
How do I set up the blocks in Kodular to:
Load Category names & images dynamically from Firebase into cards
On click → Show all quotes under that Category?
If anyone can share block examples or guidance, that would be really helpful
Thanks in advance!
I am providing the image and the aia file for you, as it may be difficult to understand.
@Glich Dear, thank you for responding to me But I have a question that after clicking on button 1
Sorry, my first question was a bit wrong.
{
“Categories”: {
“Motivation”: {
“image”: “https://example.com/motivation.jpg”,
“data”: {
“1”: “Believe in yourself and all that you are.”,
“2”: “Dream big and dare to fail.”,
“3”: “Success is not final, failure is not fatal.”
}
},
“Love”: {
“image”: “https://example.com/love.jpg”,
“data”: {
“1”: “Love is not what you say, love is what you do.”,
“2”: “In true love, there is no ending.”,
“3”: “You are my today and all of my tomorrows.”
}
},
“Friendship”: {
“image”: “https://example.com/friendship.jpg”,
“data”: {
“1”: “Friendship is the golden thread that ties the heart of all the world.”,
“2”: “A real friend is one who walks in when the rest of the world walks out.”,
“3”: “Good friends are like stars, you don’t always see them but you know they’re always there.”
}
}
}
} How to get such structure in firebase, how to set block for it
I’m not sure if you’re using an AI to answer, but there are a few parts that need correction:
It’s not enough to just add Firebase, you also need to include the JSON configuration (only if Authentication in used) .
The FirebaseToken is obtained through FirebaseAuthentication, so that should be added as well, and especially an authentication method must be configured.
Regarding loading data into cards, that could work, but some things should be explained better. “Get image” doesn’t really mean anything, it would be better to explain how dictionaries work and use the get value for key block.
If the layout is very simple, the native dynamic components can be used.
It would be more convenient to manage the various layouts in a single screen instead of switching to another one.
If another screen were to be used, it would be better to pass the entire data node (since you already downloaded it beforehand) and read from that instead of making another Firebase call.
Anyway, there are many other small things that aren’t very good or efficient.
I will step in for a minute, I can see @Boby_Sing seem new here, is it true? If yes, he needs to learn how to create Dynamic components layoutas mentioned in the middle, then being able to understand how to use firebase structures, so RayzZz and Glitch, I think we should take it easy
So my first question to @Boby_Sing can you create the quote layout using Dynamic components?
Procedure AddCategoryToFirebase(categoryName, categoryImage, dataDict)
// 1. Store image
Call FirebaseDB1.StoreValue
tag = join "Categories/" + categoryName + "/image"
value = categoryImage
// 2. Store data dictionary
For each key in dictionary keys of dataDict
set value = get value for key in dataDict
Call FirebaseDB1.StoreValue
tag = join "Categories/" + categoryName + "/data/" + key
value = value
@Ibrahim_Jamar Yes I did that, but I am not getting the settings in Firebase, and what you say is true, I am new to this right now, you can take a look at my aia once.