How to play video in fullscreen in android?

By | March 15, 2012

Hello all……

Someone has been asking me how to play a video in android in fullscreen. Then I made some surfing in the internet and found a solution.

You can check out how to play a video in android here and to check whether the video has completed playing here.
The only change was to do in the xml.

This is the xml code of the layout containing the videoview.

<?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
           android:layout_width="fill_parent"
           android:layout_height="fill_parent" >
   <VideoView android:id="@+id/myvideoview"
             android:layout_width="fill_parent"
             android:layout_alignParentRight="true"
             android:layout_alignParentLeft="true"
             android:layout_alignParentTop="true"
             android:layout_alignParentBottom="true"
             android:layout_height="fill_parent">
    </VideoView>
 </RelativeLayout>

Please leave your comments on this post.

You can download the complete source code here. Please include a video in res/raw folder and try.

Leave a Reply

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