android - Firebase 的离线功能

标签 android firebase

我想使用 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/

相关文章:

android - 多个开发人员如何在连接到单个 Firebase 控制台的同一个 Android 应用程序上工作?

ios - Firebase动态链接无法打开iOS应用

swift - 缓存的图像闪烁

xcode - "No such module ' Firebase '"将 Firebase 添加到库中时

firebase - 我的 react native 应用程序中没有重新抛出数据

java - 从 PHP 文件接收 HTTP POST 回显响应(发送 POSTS 工作正常,这是我无法弄清楚的接收)

android - 发布 XML 请求和 XML 响应 Volley 库

android - RealmBaseAdapter 是否已从 realm-java 中删除?

android - 如何使用bundletool从AAB生成APK(不是APKS)?

android - 如何在 TabLayout 中增加选项卡的图标大小