Search in sources :

Example 66 with FirebaseDatabase

use of com.google.firebase.database.FirebaseDatabase in project OnlineCanteen by josephgunawan97.

the class AccountUtil method updateUserInformationOnDatabase.

private static Task<Void> updateUserInformationOnDatabase(User user) {
    FirebaseUser firebaseUser = firebaseAuth.getCurrentUser();
    FirebaseDatabase firebaseDatabase = FirebaseDatabase.getInstance();
    DatabaseReference reference = firebaseDatabase.getReference("users");
    return reference.child(firebaseUser.getUid()).setValue(user);
}
Also used : FirebaseDatabase(com.google.firebase.database.FirebaseDatabase) DatabaseReference(com.google.firebase.database.DatabaseReference) FirebaseUser(com.google.firebase.auth.FirebaseUser)

Aggregations

FirebaseDatabase (com.google.firebase.database.FirebaseDatabase)66 DatabaseReference (com.google.firebase.database.DatabaseReference)62 DatabaseError (com.google.firebase.database.DatabaseError)36 DataSnapshot (com.google.firebase.database.DataSnapshot)34 ValueEventListener (com.google.firebase.database.ValueEventListener)30 ArrayList (java.util.ArrayList)10 ListView (android.widget.ListView)7 Intent (android.content.Intent)6 FirebaseUser (com.google.firebase.auth.FirebaseUser)6 Test (org.junit.Test)5 View (android.view.View)4 TextView (android.widget.TextView)4 ChildEventListener (com.google.firebase.database.ChildEventListener)4 AdapterView (android.widget.AdapterView)3 Button (android.widget.Button)3 Query (com.google.firebase.database.Query)3 Provides (dagger.Provides)3 SharedPreferences (android.content.SharedPreferences)2 TeamsAdapter (ca.dal.cs.athletemonitor.athletemonitor.adapters.TeamsAdapter)2 Product (com.example.asus.onlinecanteen.model.Product)2