When we start working on Firebase. We will describe how to start a project through initialization in firebase console and how to setup and use Firebase in an Android project. See the Images below

First Click on Add new Project then see new Screen.

On new Screen Write the App Name.

Choose Add Firebase to your Android App.then see new Screen

In this Screen Add Package. This Package is seen in Manifest.Xml File of your Project.

In this screen Download the json File. and add this file in project>app and then Copy paste.

Then Add Some Dependeny: –

compile 'com.google.firebase:firebase-messaging:9.6.1'

For Firebase token write some code in your onCreate Method.

if (!FirebaseApp.getApps(this).isEmpty()) {
FirebaseMessaging.getInstance().subscribeToTopic("test");
String token = FirebaseInstanceId.getInstance().getToken();
Log.e("KeyHash:", "" + token);

}