Details | |
---|---|
Returns | The Firebase.FirebaseApp instance to which this FirebaseDatabase belongs. |
staticFirebaseDatabaseDefaultInstance
Gets the instance of FirebaseDatabase for the default Firebase.App.
A FirebaseDatabase instance.
LogLevelLogLevel
By default, this is set to Info This includes any internal errors ( Error ) and any security debug messages ( Info ) that the client receives.
Set to Debug to turn on the diagnostic logging.
On Android this can only be set before any operations have been performed with the object.
The desired minimum log level
DatabaseReferenceRootReference
Gets a DatabaseReference for the root location of this FirebaseDatabase.
A DatabaseReference instance.
FirebaseDatabaseGetInstance(FirebaseAppapp)
Gets an instance of FirebaseDatabase for a specific Firebase.FirebaseApp.
Details | |||
---|---|---|---|
Parameters |
| ||
Returns | A FirebaseDatabase instance. |
FirebaseDatabaseGetInstance(Stringurl)
Gets an instance of FirebaseDatabase for the specified URL.
Details | |||
---|---|---|---|
Parameters |
| ||
Returns | A FirebaseDatabase instance. |
FirebaseDatabaseGetInstance(FirebaseAppapp,Stringurl)
Gets a FirebaseDatabase instance for the specified URL, using the specified FirebsaeApp.
Details | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns | A FirebaseDatabase instance. |
DatabaseReferenceGetReference(stringpath)
Gets a DatabaseReference for the provided path.
Details | |||
---|---|---|---|
Parameters |
| ||
Returns | A DatabaseReference pointing to the specified path. |
DatabaseReferenceGetReferenceFromUrl(Uriurl)
Gets a DatabaseReference for the provided URL.
Gets a DatabaseReference for the provided URL. The URL must be a URL to a path within this FirebaseDatabase. To create a DatabaseReference to a different database, create a Firebase.FirebaseApp with a
object configured with the appropriate database URL.
Details | |||
---|---|---|---|
Parameters |
| ||
Returns | A DatabaseReference for the provided URL. |
DatabaseReferenceGetReferenceFromUrl(stringurl)
Gets a DatabaseReference for the provided URL.
Gets a DatabaseReference for the provided URL. The URL must be a URL to a path within this FirebaseDatabase. To create a DatabaseReference to a different database, create a Firebase.FirebaseApp with a
object configured with the appropriate database URL.
Details | |||
---|---|---|---|
Parameters |
| ||
Returns | A DatabaseReference for the provided URL. |
voidGoOffline()
Shuts down our connection to the FirebaseDatabase backend until GoOnline() is called.
voidGoOnline()
Resumes our connection to the FirebaseDatabase backend after a previous GoOffline() Call.
voidPurgeOutstandingWrites()
The FirebaseDatabase client automatically queues writes and sends them to the server at the earliest opportunity, depending on network connectivity.
The FirebaseDatabase client automatically queues writes and sends them to the server at the earliest opportunity, depending on network connectivity. In some cases (e.g. offline usage) there may be a large number of writes waiting to be sent. Calling this method will purge all outstanding writes so they are abandoned. All writes will be purged, including transactions and DatabaseReference.OnDisconnect() writes. The writes will be rolled back locally, perhaps triggering events for affected event listeners, and the client will not (re-)send them to the Firebase backend.
voidSetPersistenceEnabled(boolenabled)
Sets whether pending write data will persist between application exits.
The FirebaseDatabase client will cache synchronized data and keep track of all writes you've initiated while your application is running. It seamlessly handles intermittent network connections and re-sends write operations when the network connection is restored. However by default your write operations and cached data are only stored in-memory and will be lost when your app restarts. By setting this value to true, the data will be persisted to on-device (disk) storage and will thus be available again when the app is restarted (even when there is no network connectivity at that time).
Note:SetPersistenceEnabled should be called before creating any instances of DatabaseReference, and only needs to be called once per application.
Details | |||
---|---|---|---|
Parameters |
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-06-17 UTC.