[英]Retrieve data from database (firebase)
im having trouble locating the path of my data inside the database from firebase. 即时通讯无法从Firebase定位数据库中数据的路径。 What will i need to put inside
mDatabase = FirebaseDatabase.getInstance().getReference().child("flamelink");
我需要在
mDatabase = FirebaseDatabase.getInstance().getReference().child("flamelink");
the path of the data's that i want to retrieve is flamelink/environments/production/content/contentPlaces/en-US. 我要检索的数据的路径是flamelink / environments / production / content / contentPlaces / en-US。 Hope somebody can help me.
希望有人能帮助我。 Thanks
谢谢
To put data inside mDatabase = FirebaseDatabase.getInstance().getReference().child("flamelink");
将数据放入
mDatabase = FirebaseDatabase.getInstance().getReference().child("flamelink");
you have to use .setValue()
method you will fine more here . 你必须使用
.setValue()
方法,你会在这里更多。
and to retrieve from location flamelink/environments/production/content/contentPlaces/en-US
Use 并从位置检索
flamelink/environments/production/content/contentPlaces/en-US
使用
DatabaseReference databaseReference = FirebaseDatabase.getInstance().getReference().child(flamelink).child(environments).child(production).child(content).child(contentPlaces).child(en-US);
databaseReference.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
// here you will get data
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
You will find more here about retrieving data from database. 您将在此处找到有关从数据库检索数据的更多信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.