我想使用 firebase 作为后端解决方案开发我的 android 应用程序。 现在,我已经将 firebase 视为一些离线功能,因为即使在某些时刻没有互联网,我也需要能够显示数据。 是这样的,如果没有互联网,数据是在本地检索的吗?或者我需要实现一个本地sqlite数据库来满足这个要求吗?如果是这样,您将如何实现?
谢谢,
亨利
最佳答案
参见 https://www.firebase.com/docs/android/guide/offline-capabilities.html
Every client sharing a Firebase maintains its own internal version of any active data. When data is updated or saved, it is written to this local version of the Firebase. The Firebase client then synchronizes that data with the Firebase servers and with other clients on a 'best-effort' basis.
As a result, all writes to Firebase will trigger local events immediately, before any data has even been written to the server. This means the app will remain responsive regardless of network latency or Internet connectivity.
Once connectivity is reestablished, we'll receive the appropriate set of events so that the client "catches up" with the current server state, without having to write any custom code.
关于android - Firebase 的离线功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27217015/