In this post, we want to discuss about a nice function to generate sha-1 key android or SHA-1 fingerprint of keystore certificate by Android Studio. Before we get started, if you want to know about use custom font in android studio, please go through the following article: How to use custom font in Android Studio.
Secure Hash Algorithm 1 or SHA-1 hash value is typically rendered as a hexadecimal number, 40 digits long used by organizations like Google, Facebook etc uses SHA-1 hash value for secure connection between their services and clients. Being it is an important part of establishing a secure connection between two end points and developers may need it frequently i think it is worth explaining about how to get SHA-1 hash value for a application.
If you are using Android Studio, you can find SHA-1 fingerprint of keystore certificate by very simple two way. The ways are following down:
- Run your project
- Click on Gradle menu
- Expand Gradle task tree
- Click on android-> signingReport and see the magic
- It will tell you everything
- Result Under Run Tab If Android Studio < 2.2
- From android studio 2.2
Result will be available under Run console but use highlighted toggle button
Second Way with Google Maps Activity
- Create new project in android studio New -> Google Maps Activity
- then open google_maps_api.xml xml file as shown in pics you will see your SHA key