Embed in addition to Play YouTube Video inward Android WebView
To embed YouTube video inward android spider web view, commencement yous accept to add together WebView to your XML activeness layout in addition to add together lilliputian chip code inward coffee activeness file.
Create a novel Android Project
Let’s start creating a novel android projection to embed YouTube video inward WebView amongst next information.
Application Name: Embed YouTube Video inward WebView
Company Domain: viralandroid.com
Package Name: com.viralandroid.embedyoutubevideoinwebview
Minimum SDK: Android 2.2 (API viii Froyo)
Add WebView inward XML Layout
You tin forcefulness out straight drag in addition to driblet WebView to your app xml layout. After adding WebView, your XML activeness layout looks similar this.
Add YouTube Embed Code inward Java Activity
Following is the in conclusion code of coffee activeness file. Here, I accept added YouTube video embed code inward string in addition to closed to code to command spider web view.
Add Internet Permission
Before running your application, yous accept to add together meshing permission inward your AndroidManifest.xml file. Final code of your manifest file is looks similar this.
You accept done all things. Now piece of employment your application, your app volition similar this.
Download Complete Example Project
Download consummate Embed YouTube Video inward Android WebView Example projection origin code from GitHub.