0
votes

I want to develop a Health Info System android app and use Firebase as the back-end solution. I am anticipating 400 patient records. However, I need these patient records even when there is no internet connectivity.

I am planning to create a local SQLite database that will sync with Firebase when internet is available. But, it seems to double the workload. My question is:

Can Firebase support this offline capability that I need?

2

2 Answers

0
votes

Yes Firebase does have an offline capability. You can find the details in here

https://firebase.google.com/docs/database/android/offline-capabilities

0
votes

Yes of course Firebase has offline capabilities. Even it doesn't require to store the data locally using sqlite. It caches the data in the disk when you enable it by a single line of code.

FirebaseDatabase.getInstance().setPersistenceEnabled(true);

Here's the doc explaining the offline capabilities nicely.

You can query in the data stored offline too. Firebase runs query over the data which is already loaded even after an application restart. The provided doc explains it well.

In case of you're using Firebase Authentication, then you need to remember that, if the token expires when your application is offline, you need to refresh the token again when your application comes to online.

I've read this before. My concern is that it says it handles only temporary internet interruptions. Can firebase still handle it even just connecting to the internet every week?

Yes, it should. I haven't tested it though. But the documentation says so.