title: How do I incorporate admob ads if I don't have an XML layout?
body: <p>All the documentation I've read references a layout like activity_main.xml, but my app doesn't use layouts.  When I did create one per the example found <a href="https://github.com/googleads/googleads-mobile-android-examples/tree/master/admob/banner" rel="nofollow">here</a> it does display the ad, but the rest of the screen is black!</p>
  
  <p>I've provided my activity good so you can see where I'm at.  All I want is to add the banner to the bottom of the screen while also having the app running and visible.  Any help would be truly appreciated!</p>
  
  <p>Here is my code:</p>
  
  <pre><code>@Override
  public void onCreate( Bundle savedInstanceState )
      {
          super.onCreate( savedInstanceState );
          setContentView(R.layout.activity_main); // new
  
  
          // Initialize ad system
  
          m_adView = new AdView(this);
  
         m_adView.setAdSize(AdSize.SMART_BANNER);
  
         m_adView.setAdUnitId(AD_UNIT_ID);
  
         LinearLayout layout = (LinearLayout) findViewById(R.id.linearLayout); //new
         layout.addView(m_adView); // new
  
         AdRequest adRequest = new AdRequest.Builder()
              .addTestDevice( AdRequest.DEVICE_ID_EMULATOR )
              .addTestDevice( "64F3835CFF94C302E82205EDC204B315" ) 
              .build() ;
  
         m_adView.loadAd(adRequest);}
  </code></pre>
  
  <p>The layout I created looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/linearLayout"
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent"&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>