title: Cant write data to firebase database Android
body: <p>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).</p>
  
  <p>Then I add sample code in my activity:</p>
  
  <pre><code>FirebaseDatabase database = FirebaseDatabase.getInstance();
  DatabaseReference myRef = database.getReference("message");
  
  myRef.setValue("Hello, World!");
  </code></pre>
  
  <p>I set the rules in firebase:</p>
  
  <pre><code>{
    "rules": {
      ".read": true,
      ".write": true
    }
  }
  </code></pre>
  
  <p>But the data does not add to the realtime database. Maybe I need some permission? In logcat AS nothing error</p>
  
  <p><strong>UPD:</strong></p>
  
  <p>not add data</p>
  
  <pre><code>    private DatabaseReference mDatabase;
   mDatabase = FirebaseDatabase.getInstance().getReference();
          mDatabase.child("message").setValue("Hello, World!");
  </code></pre>
  
  <p>not add data too</p>
  
  <pre><code>Message mess = new Message("hello");
          mDatabase.child("message").setValue(mess);
  </code></pre>
  
  <p>class Message</p>
  
  <pre><code>@IgnoreExtraProperties
  public class Message {
  
      public String mes;
  
      public Message(){}
  
      public Message(String mes) {this.mes = mes;}
  
  }
  </code></pre>