@ - vj- @ ==> The API key is based on the short form of your digital application certificate, known as its SHA-1 fingerprint. To display the SHA-1 fingerprint for your certificate, first make sure that you are using the correct certificate. You can have two certificates:
-> Debug certificate: Android SDK tools automatically generate this certificate when you build debugging. Use this certificate only with applications that you are testing. Do not try to publish an application signed with a debug certificate. The debug certificate is described in more detail in the "Signing in Debug Mode" section of the Android developer documentation.
-> Release Certificate: Android SDK tools generate this certificate when creating the release. You can also generate this certificate using keytool. Use this certificate when you are ready to release the application into the world.
==> Display debug certificate fingerprint
Locate the debug repository file. The file name is debug.keystore and is created when the project is first created. By default, it is stored in the same directory as the Android Virtual Device (AVD) files:
macOS and Linux: ~/.android/
Windows Vista and Windows 7: C:\Users\your_user_name\.android\
List the SHA-1 fingerprint:
For Linux or macOS, open a terminal window and enter the following:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
For Windows Vista and Windows 7, run:
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
==> Display the fingerprint of the certificate of issue
Locate the release key store file. There is no default location or name for the release key store. If you do not specify when you will create the application for release, the assembly will leave your .apk unsigned and you will have to sign it before you can publish it. For a certificate of issue, you also need a certificate alias and passwords for the keystore and certificate. You can list the aliases for all keys in the keystore by entering:
keytool -list -keystore your_keystore_name
Replace your_keystore_name
with the full path and name of the keystore, including the .keystore extension. You will be prompted for a keystore password. Keytool then displays all the aliases in the keystore. At the command prompt, enter the following command:
keytool -list -v -keystore your_keystore_name -alias your_alias_name
Replace your_keystore_name
with the full path and name of the keystore, including the .keystore extension. Replace your_alias_name
alias you assigned to the certificate when you created it.