Created
January 19, 2018 23:53
-
-
Save yusufcakal/1dee3c91bdf1983fb1dd6e4ff37cbaf6 to your computer and use it in GitHub Desktop.
Firebase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FirebaseUtil { | |
public static void saveData(){ | |
List<Author> authorList = new ArrayList<>(); | |
Author author1 = new Author("Robert C. Martin"); | |
authorList.add(author1); | |
Book book = new Book("Clean Code", authorList); | |
DatabaseReference database = FirebaseDatabase.getInstance().getReference(); | |
DatabaseReference databaseBook = database.child("book"); | |
databaseBook.push().setValue(book); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment