Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How firebase persistence stores local data for my Android app

I am making an android app similar to WhatsApp. In the app users can send text as well as images. To save the messages so that they can be viewed offline I used :

FirebaseDatabase.getInstance().setPersistenceEnabled(true);

I was wondering how does firebase store messages offline.

Does it create a local database similar to the commonly used sqlite?

like image 389
Arnav Vohra Avatar asked Jul 20 '16 19:07

Arnav Vohra


People also ask

Can Firebase store data locally?

The Firebase Realtime Database synchronizes and stores a local copy of the data for active listeners. In addition, you can keep specific locations in sync. The Firebase Realtime Database client automatically downloads the data at these locations and keeps it in sync even if the reference has no active listeners.

How does Firebase store its data?

Firebase Realtime Database is a NoSQL cloud database that is used to store and sync the data. The data from the database can be synced at a time across all the clients such as android, web as well as IOS. The data in the database is stored in the JSON format and it updates in real-time with every connected client.

Does Firebase store user data?

Firebase users have a fixed set of basic properties—a unique ID, a primary email address, a name and a photo URL—stored in the project's user database, that can be updated by the user (iOS, Android, web).

Where does Firebase store auth data?

The user data for firebase authentication is stored in firebaseLocalStorageDb in IndexedDB .


1 Answers

firebaser here

The disk based local storage of the Firebase Database is a sqlite database that is structured opaquely in a way that your app shouldn't care about. The only way you should access the data is through the Firebase API.

like image 122
Frank van Puffelen Avatar answered Nov 10 '22 00:11

Frank van Puffelen