How to play Video in Android

Hello Geeks!! Today you ll learn how to play a video in android using VideoView.


Create an Activity “SplashScreen” and paste the following code in the layout of the activity.


Create a folder “raw” inside the res directory of the project and paste the video file that you want to play in your app.
File format supported are .mp4, .3gp.


Use the following code to play the video when the activity launches. If you want to do something after the video completes use the setOnCompletionListener() method.

admin Author

Leave a Reply

Your email address will not be published. Required fields are marked *