hello everyone, I'm just starting to learn how to program in Android. However, I had a problem with emulator, but I fixed, and here come my question. in the ( layout ) Folder there are two xml files and I'm not sure why.

Note: When I create an ( Android Application Project ) they both created automatically

The first one: activity_main.xml

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.m003.MainActivity"
    tools:ignore="MergeRootFrame" />

The second fragment_main.xml

 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.m003.MainActivity$PlaceholderFragment" >
 
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world" />
 
</RelativeLayout>

Could any tell me what is the different between these two.

Also another thing, why another package is created with one that I all ready created? every time I create a new ( Android Application Project ). what I mean that in the ( src ) Folder I have one package, and in the ( gen ) there is another one. why I would need both of them ?