Search in Firebase

0

Good morning friends, I have the following structure in firebase. I need to do a search on my bank, showing all the products that are in the child No Bar, and also the supermarkets and price that are saved inside each product. I did not find any method that would help me display all the supermarkets. Can anybody help me?

    
asked by anonymous 20.06.2018 / 22:13

1 answer

0

Answering your question correctly would take a long time, so I'll be responding in a way to help you with what you crave. I usually work with the 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 download bulk data using a class (object) with its gets and sets, where each variable must have exactly the same name as the Firebase keys.

There is an asynchronous listener that looks at whether there has been any change in your data, so that every time you change it, everything will be updated automatically. Soon, you can reference which ones you want and call what data you want. I also like to control asynchronous data by saving them with SharePreferences from Android and this makes my life a lot easier.

You can not explain it in too many details, because it's a lot, but I think it's a good way. Any questions will complement the answer if possible.

    
20.06.2018 / 23:14