How To Get Admob In Webview?
I have a web page that I load via webView. Page has a div block to show an advertize and my task is get this div blok and insert code for adMob. Unfortunatly I doesn't found any do
Solution 1:
First advice: do not use webview unless you are forced to.
To display an as in an application, do not use the web one, but an AdView (https://developers.google.com/mobile-ads-sdk/download#downloadandroid)
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="MY_AD_UNIT_ID"
ads:adSize="BANNER"
ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID"
ads:loadAdOnCreate="true"/>
Place your AdView below your Webview and voila!
Post a Comment for "How To Get Admob In Webview?"