title: How to show Interstitial ad in webView app?
body: <p>I want to show Interstitial ad on my webview android app but I am unable to implement it.</p>
  
  <ul>
  <li><p>I have an webview app which is fully online, with no offline pages or any button or menu. </p></li>
  <li><p>I don't want to show Interstitial ad on starting or closing app.</p></li>
  <li>Ad should be shown when user browse my website using that webview app.</li>
  <li>I thought to use Interstitial ad after x minutes, but I have learned Interstitial ad after x minutes is not a good idea from <a href="https://stackoverflow.com/questions/26727454/integrating-interstitial-ads-and-show-every-x-minute">here</a> and <a href="https://stackoverflow.com/questions/19209855/interstitial-ad-loading-after-every-1-minte">here</a>.</li>
  <li>Then how can I show Interstitial ad on my app as I told, I don't have any button or menu but only a website to browse.</li>
  <li>Please suggest me how can I use Interstitial ad on my webview app.</li>
  <li>I tried and successfully implement BANNER ad.  with the help of stackoverflow question-answer and <a href="https://developers.google.com/admob/android/quick-start" rel="nofollow noreferrer">Google</a>  (code given below) but failed to implement Interstitial ad by any means </li>
  <li>I'm very much new in this sector so please suggest me with detail process means where put code etc.</li>
  </ul>
  
  <p>Activity_main.xml</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:ads="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.xxxx.yyyyy.MainActivity"
      android:layout_gravity="center"
      android:id="@+id/fl"&gt;
  
      &lt;WebView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:id="@+id/wv"/&gt;
      &lt;ProgressBar
          android:id="@+id/progressBar"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" /&gt;
  
  
      &lt;com.google.android.gms.ads.AdView
          android:id="@+id/adView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerHorizontal="true"
          android:layout_alignParentBottom="true"
          ads:adSize="BANNER"
          ads:adUnitId="ca-app-pub-xxxxx/xxxxxx"&gt;
      &lt;/com.google.android.gms.ads.AdView&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Mainactivity java </p>
  
  <pre><code>import com.google.android.gms.ads.AdListener;
  import com.google.android.gms.ads.AdRequest;
  import com.google.android.gms.ads.AdView;
  import com.google.android.gms.ads.InterstitialAd;
  import com.google.android.gms.ads.MobileAds;
  
  MobileAds.initialize(this, "xxxxxx~xxxxxx");
          AdView adView = (AdView)findViewById(R.id.adView);
  
          AdRequest adRequest = new AdRequest.Builder()
                  .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
                  .addTestDevice("xxxxxxx")
                  .build();
          adView.loadAd(adRequest);
  </code></pre>
  
  <p>using firebase (build.gradle)</p>
  
  <pre><code>compile 'com.google.firebase:firebase-ads:10.2.6'
  </code></pre>