<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="horizontal"
    android:baselineAligned="false"
    tools:context=".MainActivity" >
 
    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="fill_parent"
        android:layout_weight="1"
        android:gravity="center"
        android:orientation="vertical" >
 
        <!-- Capture picture button -->
        <Button
            android:id="@+id/btnCapturePicture"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Take a Picture"
            android:layout_marginBottom="10dp"/>
 
        <!-- Record video button -->
        <Button
            android:id="@+id/btnRecordVideo"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Record a Video" />
    </LinearLayout>
 
    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="fill_parent"
        android:layout_weight="1"
        android:orientation="vertical"
        android:padding="10dp">
 
        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="Preview"
            android:padding="10dp"
            android:textSize="15dp"/>
 
        <!-- To display picture taken -->
        <ImageView
            android:id="@+id/imgPreview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:visibility="gone" />
 
        <!-- To preview video recorded -->
        <VideoView
            android:id="@+id/videoPreview"
            android:layout_width="wrap_content"
            android:layout_height="400dp"
            android:visibility="gone" />
    </LinearLayout>
 
</LinearLayout>