Showing and playing Youtube videos in RecyclerView.
- First we need to get the SHA-1 fingerprint on your machine using java keytool. Execute the below command in cmd/terminal to get the SHA-1 fingerprint.
On Windows keytool -list -v -keystore "%USERPROFILE%.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
On Linux or Mac keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
-
Go to Google Developer Console and select or create a new project. (https://console.developers.google.com/)
-
turn the status ON for YouTube Data API v3.
-
On the left sidebar, select Credentials and Create new key under Public API acess.
-
When popup comes asking you to choose platform, select Android Key.
-
Paste the SHA-1 key and your project’s package name.
-
Click on create. Now you should see the API KEY on the dashboard.