June 2018
Beginner to intermediate
394 pages
9h 2m
English
Fetch an instance of your database employing getInstance() and reference the location you need to write. You can write most of the primitive data types as they also include Java objects:
// Write a message to the databaseFirebaseDatabase mDatabase = FirebaseDatabase.getInstance();DatabaseReference mDbRef = mDatabase.getReference("Donor/Name");mDbRef.setValue("Parinitha Krishna");
The following screenshot explains the dashboard changes after running the preceding code:

If you notice that there aren't any changes in the dashboard from the write operation, we shall attach an onFailure callback like the following ...
Read now
Unlock full access