Skip to main content

Posts

Showing posts from 2019

Google Sign-in for Android App

This is demo application implementing Google Sign-in in android application. Screenshots of the application are when you click on the sign in button popup will be shown to select google account for sign in . After signing in , user can see his profile photo,name and Email id in the login screen . User can sign out using signout button . Disconnect button will provide user ability to disconnect their google account from the app. Before we start coding for our application , we need to turn on sign-in API for our app in google developer console. Go to this link to know  how to turn on google sign-in api for our app https://androidtuts4u.blogspot.com/2019/09/enabling-sign-in-api-in-google.html now we successfully configured Google Api console project .  we can start coding our application. I . first we need to configure build.gradle file we need to add two dependencies   1. google play service dependency for google sign-in.    2 . we are using third party library

Enabling Sign-in APi in Google Developer console

We need to enable Sign-in Api for our application in google developers console to use google sign-in  in our application. 1 . first we need to create a project in google developers console     visit google developers  console        https://console.developers.google.com/project 2 .  Click on create project button you will see the below screen     3 .  Enter project name and click CREATE . Then we are directed to project home page  which will look like this 4 .  Next we need to add Google API to our project. click on library on left menu and search for google api 5 .  Configure  OAuth consent screen , click on 'OAuth consent screen '  6  .  Enter Application name and email id everything else is optional  and click save   7  . Configure Credentials        Google uses this to ensure that your application is not fake application . For the purpose of development we use debug certificate. When we deploy our app on play store we need real certificat

Keytool is not recognized as internal or extenal command / Adding PATH in system variable

If you are running a keytool command  keytool -list -v -keystore C:\Users\arun\.android\debug.keystore -alias androiddebugkey -storepass android    and getting an error   'keytool' is not recognized as an internal or external command  If you are using any other commad like java,javac , etc.. and getting an error " is not recognized as an internal or external command"  you can also use this same steps  you are getting this error because keytool.exe , executable file which exists in the bin directory of your JDK  is not added to Path in your Environmental variables. To resolve this issue 1 .first we need to find the bin Directory of our jdk    Usually this will be in  C:\Program Files\Java\jre1.8.0_221\bin (jre1.8.0_221 - change this to your latest version , ). you can see keytool.exe file in the bin directory . (If you installed jdk in a different directory Find your Jdk installation folder and  use that path.) 2 . we need to add this bin directory