Adding Admob Ads at the bottom of RelativeView

Many of us know how to add admob Ads to our view
now we will see ho wto add AdMob ads At the Bottom of view

Step1#This you Sould Declair in MainActivity under OnCreate()

 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);  
  setContentView(R.layout.activity_main);
  
 // Create an ad.
  adView = new AdView(this);
  adView.setAdSize(AdSize.SMART_BANNER);     
  adView.setAdUnitId(AD_UNIT_ID);
     
 // Add the AdView to the view hierarchy. The view will have no size
 // until the ad is loaded.
 RelativeLayout layout = (RelativeLayout) findViewById(R.id.relativelayout);
    layout.addView(adView);
     
     RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) adView.getLayoutParams();  
     params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);
     adView.setLayoutParams(params);                                     
   
     
        // get test ads on a physical device.
        AdRequest adRequest = new AdRequest.Builder()
            .addTestDevice(AdRequest.DEVICE_ID_EMULATOR) ===>Comment when you running on actual device
          //  .addTestDevice("INSERT_YOUR_HASHED_DEVICE_ID_HERE")
            .build();      
        // Start loading the ad in the background.                        adView.loadAd(adRequest);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     }