Configuration of your project in Google API Console:
Following steps you have to follow before you start coding,Create a new project in android studio. Now, in your app-level build.gradle file, add
implementation 'com.google.android.gms:play-services-auth:16.0.1'
Now sign in to your google account from browser and open configure your projectAt this point, you have already dependency in your gradle. So jump to the next step i.e.
Click on the Create a project
Now, if you have already created a project in google API Console and want to integrate google Sign In in that project then open drag down list and select existing project. Otherwise you can create a new project.
So, next console will require details regarding your application package and SHA - 1 key.
You can copy your package name from your AndroidManifest.xml file.
Now, to generate SHA - 1 key for your project, do the following,
Go to Gradle that is present at right side in your android studio window, click on it. So it will show a tree structure. Select ApplicationName → ApplicationName (root) → Tasks → android → signinreport Now, run that signinreport by double clicking on it. Now you can see that SHA - 1 key is generated in Run windnow. Copy that key and paste in google API Console.
Click on next and then download configuration file. Now paste that credentials.json file into your app directory.
implementation 'com.github.bumptech.glide:glide:3.6.0'
Coding part:
activity_main.xml:
MainActivity.java:
activity_profile.xml:
ProfileAcitivity.java:
Now, add <uses-permission android:name="android.permission.INTERNET"/> in your AndroidManifest.xml file.
Run the application now. It will look like this,
Well, I hope you understand this and let me know if you have any doubts :D