Functionality to dynamic buttons and upload them to Firebase

Hello, as some of you know, I’m very, very new to Code and programming. I don’t intend to offend any members of this community.
I’d like to know if someone could guide me on how to assign a function to each of the dynamic components in a cardview. These are: Image, Title, Price, and Stock. Below are three buttons: Save, Edit, and Delete.

Knowing this, I want to upload all of these components to Firebase, but I haven’t found any templates online to guide me through this process.
For example, when I fill in the data and press Save, everything is uploaded to Firebase. When I edit, I can take that data from Firebase and modify it, and the same with the Delete button.

I’ve read quite a bit, and from what I understand, I need the IDs, make variants, and create procedures. That’s where I get dizzy and don’t know where to start. If anyone has time, could you show me a basic template so I can get an idea of ​​how to start creating all of these blocks and if I need to add any extensions? Thank you very much in advance.

I would also like that every time I click the save button, that card is saved in the app, leaving only the edit or delete button available.
Because as it is now, when I add a cardview with data, I press another button in the app, and when I go back to the home screen, it disappears.

Well, using Gemini, I’ve tried to do something. I think what I’ve done is a step forward, but it still doesn’t save the values ​​entered in the text boxes when I press save. I’ll show the blockchain and the Firebase response.


You want to upload as admin or user?

If admin mean no issue, else if it is user, how will you he is the user? Using any firebase authentication? Bytheway what is the purpose of your app? So we can try to suggest you the best 1

Thanks for responding. I owe you a million thanks regarding your question. My next idea is to upload the cardview to the admin app with all the items we analyzed and developed earlier. I want to upload both the image and the text box values ​​to Firebase.

And your answer ends. I’m also creating an app for users. But that app is simple. They log in without any data, just to see the products they upload from the admin app. I don’t know if that’s clear.

My original idea was for a person to upload the products they sell in their admin app and share the USER APP with their customers so they can see the products being uploaded in real time. And well, not only see the product, but also be able to purchase it, but also have a reserve button. I don’t know if I was clear about the idea.

The admin app will upload the image, title, price, and stock, and the user app will have to read the data along with the image and its corresponding title, price, and quantity of products available. I want the user app to appear exactly as it was uploaded in the admin app.

I would also like to return to the admin app, if fields are missing in the cardview, so that it doesn’t allow me to save. I press save and the save button is automatically disabled, leaving only the edit or delete button enabled.

The way I have the app now, when I press save, I move between the menus, and when I return, everything is deleted.

Well thats good, now, actually i forget to ask, do you want to save each cardview as separate tag? Or want to add under the same id.? If possible share with us the expecting style you want to use in the firebase?

Products:
01:Tbox1,tbix, tbkx3,image
02: Tbox1,Tbox2,Tbox3,image…

or

Product1
Tbox 1: value
Tbox 2: value
Tbix 3: value
Image: image value

Product 2
Tbox 1: value
Tbox 2: value
Tbix 3: value
Image: image value

Or anyother style?

Also remember, you cannot upload the images to firebase realtime databse. You need to upload to firebase storage or cloudinary then get image url and then save this url in the firebase database

Or you may use google sheet and google drive where using app scripts we can do it all

Of course, I want to see the same cardview in the user app that was uploaded in the admin app, only without the dynamic buttons. And what if I want to upload everything to Firebase, including the image, in this format?

Product 1
Tbox 1: value
Tbox 2: value
Tbox 3: value
Image: image value

Easily we can upload the texts into RTDB but image cannot, instead of it may use image url

1 Like

Yes, as you say, but the problem is that I’m super dizzy. I thought it was going to be easy, but now it’s not. The data can be uploaded to Firebase, but I have to pay for Firebase storage for the image. Otherwise, get a cloud server with free storage only.

In such case why not use google sheet and google drive as they are always free

1 Like

I was planning on using Google Drive, but until I resolved all of this, both on the administrator side of the app and then configuring the user app to read the data uploaded by the other app, I’ll use Google Drive until then.

Well, if you have time and want to analyze the AIA, let me know.

1 Like