This repo is a very simple (but working!) android chat using Firebase Relatime Database! This Google I/O conference may be helpful if you're learning like me: https://www.youtube.com/watch?v=xAsvwy1-oxE
In your build.gradle Project file, add:
classpath 'com.google.gms:google-services:3.0.0'
In your build.gradle Module file, add:
apply plugin: 'com.google.gms.google-services' // top of the file
compile 'com.google.firebase:firebase-database:9.4.0' // dependencies
Then open up your SDK Manager and install Google Play Services and Google Repository (both are located under Extras).
You should have generated a google-services.json file with Firebase website, place it at: /YourProject/app
That's it, you should be ready to code!
The app is not using any kind of authentication, thus your firebase server should accept every connection. Of course this is not secure, this was just for the example.