HhMobile
HhMobile

Reputation: 31

Offline capabilities of Firebase

I want to develop my android app with firebase as a backend solution. Now, I have seen that firebase as some offline capabilities, cause I need to be able to show data even if there is no internet at some moments.. Is this so, that if there is no internet, data are retrieved locally? Or do I need to implement a local sqlite database to meet this requirement? If so, how would you implement it?

Thanks,

Henry

Upvotes: 1

Views: 1194

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 600141

See 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.

Upvotes: 2

Related Questions