title: difficulty with firebase database. Invalid database path
body: <p><a href="https://i.stack.imgur.com/uInXE.png" rel="nofollow noreferrer">struct db</a>  Caused by: com.google.firebase.database.DatabaseException: Invalid Firebase Database path: <a href="https://eleicoes-f6d73.firebaseio.com/" rel="nofollow noreferrer">https://eleicoes-f6d73.firebaseio.com/</a>. Firebase Database paths must not contain '.', '#', '$', '[', or ']'
   at br.com.eleicoes.eleicoes.MainActivity.(MainActivity.java:37)
  06-28 20:16:09.973 28933-28933/br.com.eleicoes.eleicoes E/AndroidRuntime: FATAL EXCEPTION: main</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  TextView resposta;
  Button bt1;
  final FirebaseDatabase database = FirebaseDatabase.getInstance();
  DatabaseReference ref = database.getReference("https://eleicoes-f6d73.firebaseio.com/");
  
  private FirebaseAuth mAuth;
  private FirebaseAuth.AuthStateListener mAuthListener;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
      setSupportActionBar(toolbar);
      mAuth = FirebaseAuth.getInstance();
      // [START initialize_auth]
      mAuth = FirebaseAuth.getInstance();
      // [END initialize_auth]
  }
  
  // [START on_start_check_user]
  @Override
  public void onStart() {
      super.onStart();
      resposta = (TextView) findViewById(R.id.resposta);
      bt1 = (Button) findViewById(R.id.bt1);
      // Check if user is signed in (non-null) and update UI accordingly.
      FirebaseUser currentUser = mAuth.getCurrentUser();
  
  
      ref.addValueEventListener(new ValueEventListener() {
          @Override
          public void onDataChange(DataSnapshot dataSnapshot) {
              String post = dataSnapshot.getValue(String.class);
  
              resposta.setText(post);
          }
  
          @Override
          public void onCancelled(DatabaseError databaseError) {
  
          }
      });
  }
  
  
  // [END on_start_check_user]
  
  private void signInAnonymously() {
  
      // [START signin_anonymously]
      mAuth.signInAnonymously()
              .addOnCompleteListener(this, new OnCompleteListener&lt;AuthResult&gt;() {
                  @Override
                  public void onComplete(@NonNull Task&lt;AuthResult&gt; task) {
                      if (task.isSuccessful()) {
                          // Sign in success, update UI with the signed-in user's information
  
                          FirebaseUser user = mAuth.getCurrentUser();
  
                      } else {
                          // If sign in fails, display a message to the user.
  
                          Toast.makeText(MainActivity.this, "Authentication failed.",
                                  Toast.LENGTH_SHORT).show();
  
                      }
  
  
                  }
              });
  }
  
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.menu_main, menu);
      return true;
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      // Handle action bar item clicks here. The action bar will
      // automatically handle clicks on the Home/Up button, so long
      // as you specify a parent activity in AndroidManifest.xml.
      int id = item.getItemId();
  
      //noinspection SimplifiableIfStatement
      if (id == R.id.action_settings) {
          return true;
      }
  
      return super.onOptionsItemSelected(item);
  }
  
  
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/owmfV.png" rel="nofollow noreferrer">error log</a></p>