Search in Firebase

Asked

Viewed 138 times

0

Good morning friends, I have the following structure at firebase. I need to search my bank, displaying all the products that are on Child Sem Barra, and also the supermarkets and price that are saved within each product. I couldn’t find a way to show off all the supermarkets. Someone could help me? inserir a descrição da imagem aqui

1 answer

0

Answering your question correctly would take me a long time, so I will be answering in order to help you with what you are aiming for. I usually work with firebase as standardized as possible and this always helps me, schematic example:

achocolatado_1:
    estado: CE
    cidade: Fortaleza
    supermercado: Meu Supermercado
    ...

café_1:
    estado: RS
    cidade: Pelotas
    supermercado: Supermercado Compra Bem
    ...

and so on. Look in the Firebase documentation for how to bulk download data using a class (object) with your gets and sets, where each variable should have exactly the same name as the Firebase keys.

There is a Listener asynchronous that notes if there has been any change in your data and so, whenever you change them, everything will be updated automatically. So you can reference what we want and call what data you want. I also like to control the asynchronous data saving them with Android Sharepreferences and this makes my life much easier.

There is no way to explain it to you in detail because it is a lot of things, but I believe it is a good way. Any doubt I will supplement the answer if possible.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.