Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android local SQLite sync with Firebase

Tags:

I have an app where the default option is to store user data as a local SQLite database, however, I want to add the option if the user wants to sign in and transfer the local database to an online database so it can be accessed on multiple devices.

I don't have much experience with cloud storage solution so any advice would be really appreciated. Is for my application the Firebase Real-time Database the best online solution or is there another approach I should look into?

like image 726
donny.rewq Avatar asked May 21 '16 14:05

donny.rewq


1 Answers

Firebase's real-time database is indeed one of the best solutions for your problem. It has a generous free plan and is well integrated into Android Studio. And if your data structure is simple enough, you can drop SQLite altogether and use Firebase's offline storage. This will allow Firebase to automatically handle syncing of offline data for you(syncing is usually painful to implement by yourself).

Alternatively, you could build your own web app and expose a REST API to your android application. This gives you the advantage of having control over everything. I would however not recommend this because of the amount of knowledge and time required.

like image 79
kessir Avatar answered Sep 20 '22 18:09

kessir