I am trying to send test data to my firebase database. In android studio I chose Tools > Firebase > Assistant FB > Realtime Database > Connect your app to Firebase(Connected) > Add the realtime database to your app(dependencies set up correctly).
Then I add sample code in my activity:
FirebaseDatabase database = FirebaseDatabase.getInstance();
DatabaseReference myRef = database.getReference("message");
myRef.setValue("Hello, World!");
I set the rules in firebase:
{
"rules": {
".read": true,
".write": true
}
}
But the data does not add to the realtime database. Maybe I need some permission? In logcat AS nothing error
UPD:
not add data
private DatabaseReference mDatabase;
mDatabase = FirebaseDatabase.getInstance().getReference();
mDatabase.child("message").setValue("Hello, World!");
not add data too
Message mess = new Message("hello");
mDatabase.child("message").setValue(mess);
class Message
@IgnoreExtraProperties
public class Message {
public String mes;
public Message(){}
public Message(String mes) {this.mes = mes;}
}
+and then adding name and value does it work? - Peter Haddad+. Then i check, and i add data from hurl.it http://take.ms/nzHKx I cant understand why from android app data not add - r1299597message:hello, World under root node - Peter Haddad