Skip to content Skip to sidebar Skip to footer

Firebase Android - Only Need Specific Table To Be In Local Device

I am using Firebase realtime database in my Android application. I have replica of database in local device using below line of code - FirebaseDatabase.getInstance().setPersistence

Solution 1:

When you are using the following line of code:

FirebaseDatabase.getInstance().setPersistenceEnabled(true);

All the data that the user recently received is cached to disk.

Is there any way to only sync a few tables in local memory and the rest of the table android device will read from the global database?

No, there is not! There is no way to exclude certain nodes from that disk persistence. Unfortunately, you cannot choose whether a node should be or shouldn't be cached on the disk. It's all or nothing.

Post a Comment for "Firebase Android - Only Need Specific Table To Be In Local Device"