How to update firebase database instantly when there is no internet connectivity?
There is no way in which you can update a Firebase database while you are offline. When there is no internet connectivity on user's device it means that the user cannot reach Firebase servers, with other words no changes will be made on Firbease servers but, if you are using the following line of code:
FirebaseDatabase.getInstance().setPersistenceEnabled(true);
It means that you'll be able to query your the database even if you are offline. This is happening because Firebase creates a local copy of your database. Every change that is made while you are offline, will be updated on Firebase servers once you are back online. To be more clear, every client that is using a Firebase database and uses setPersistenceEnabled(true)
maintains it's own internal (local) version of the database. When data is updated, it is first written to this local version of the database.
There is also a post on which I have answered a few minutes ago and I think you might be interested.