Firebase Veri Kaydetme

Firebase Veri Kaydetme

private DatabaseReference mDatabase;
mDatabase = FirebaseDatabase.getInstance().getReference();
public class User {

    public String username;
    public String email;

    public User() {
    }

    public User(String username, String email) {
        this.username = username;
        this.email = email;
    }
}
private void writeNewUser(String userId, String name, String email) {
    User user = new User(name, email);

    mDatabase.child("users").child(userId).setValue(user);
mDatabase.child("users").child(userId).child("username").setValue(name);
}

Leave a Reply