title: How to turn static AdMob code into dynamic code
body: <p>I'm adding <em>AdMob</em> to my application. Apparently I need to add the following layout snippet to each one of my layouts:    </p>
  
  <pre><code> &lt;LinearLayout
       android:id="@+id/linearLayout"
       android:orientation="vertical"
       android:layout_below="@+id/button2"
       android:layout_width="fill_parent"
       android:layout_height="wrap_content" /&gt;
  </code></pre>
  
  <p>However, I'd rather add the above snippet dynamically, instead of copy-pasting it into each layout. </p>
  
  <p>What I am having trouble with is translating the following snippet: </p>
  
  <pre><code>android:layout_below="@+id/button2"
  </code></pre>
  
  <p>into Java code. </p>