Play video in Android with example

In this tutorial explain that how to play video in android. Taking a video(3gp) file inside application raw folder and playing in on activity. The file structure is given as below:


Create a file in src as and use given code. Using VideoView class to load video from various sources , takes care of computing its measurement from the video so that it can be used in any layout manager, and provides various display options such as scaling and tinting.


The main.xml code to Define VideoView as xml element to play video on activity.


Copy the below code in the AndroidManifest.xml