If you’re using Android studio 2.3.3 or greater, it’s quite easy of a task.
(window appears on right of the app)
from there ‘Connect to firebase’
<You might have to log in to your google account and grant certain permissions to Android Studio>
Then it shows you a list of existing firebase projects (Also an option to create a fresh one)
select one of them and voila!
Then you can connect to particular service from firebase in a similar way, or import all of them at a time from the panel and they also provide sample codes to get you up to speed in no time.
PS: if you’re in a lower version of Android Studio, the process if tedious. I recommend getting Android 3.0 that comes with Kotlin support and also much more.