Firebase Android - Only need specific table to be in local device

不想你离开。 提交于 2019-12-31 05:07:10

问题


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().setPersistenceEnabled(true);

But it will sync all the tables between local and global database. I only want few table need to be sync not all.

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


回答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.



来源:https://stackoverflow.com/questions/54047550/firebase-android-only-need-specific-table-to-be-in-local-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!