Questions tagged [adview]

Google Adview is an API to show advertisements from Google Admob / AdSense on smartphones and tablets on the Android, iOS and Windows Mobile platforms.

Google Adview is an API to show advertisements from Google Admob / AdSense on smartphones and tablets on the Android, iOS and Windows Mobile platforms.

Questions tagged with are related to the operation and behaviour of this API.

API homepage

300 questions
48
votes
7 answers

The ad size and ad unit ID must be set before loadAd when set programmatically

I have no idea what is going on here but I am trying to set my ad unit ID dynamically through code like below and removing it from the XML but still get the error: The ad size and ad unit ID must be set before loadAd is called.
Mike Flynn
  • 22,342
  • 54
  • 182
  • 341
25
votes
5 answers

How to know if AdMob ad has been loaded

My Andorid app works offline and online. It displays ads when it is in online mode. In a scenario where it is working in offline mode and user switches the internet connectivity on, I want to know if the ad is already loaded. If not, then I would…
Balkrishna Rawool
  • 1,865
  • 3
  • 21
  • 35
22
votes
4 answers

How to use addView to add view to layout?

I have read probably all posts and documentation but I still can't solve this issue. I want to use addView() method to add view to the existing (running) layout but for some reason I cant. I know that this should be easy and basic but still I cant…
Majstor
  • 859
  • 1
  • 12
  • 22
19
votes
5 answers

AdView causes memory leak

I'm using AdView and LeakCanary. Fragment that hosts adView call adView.destroy() in onDestroy, but LeakCanary shows that Activity that hosts this fragment is leaked by com.google.android.gms.common.api.a.a.a.i . Heap dump also shows that there are…
Alex Perevozchykov
  • 2,211
  • 22
  • 19
16
votes
0 answers

Android: WebView stops loading after several pages

I have a webview I am loading custom HTML into using loadDataWithBaseURL: mArticleWebView.loadDataWithBaseURL("http://www.example.com/", htmlString, "text/html", "utf-8", null); This will work for several pages, and then events stop firing in the…
16
votes
3 answers

WebViewCoreThread used by admob AdView is using high CPU even when parent Activity is paused

I'm using Google Admob SDK v6.1.0 (https://developers.google.com/mobile-ads-sdk/download), and I instantiate the com.google.ads.AdView programmatically (not in XML), and add it into a LinearLayout, dynamically in my Activity. One of my users…
Shiprack
  • 1,095
  • 11
  • 18
15
votes
2 answers

How to specify adUnitId programmatically for AdMob?

I'm trying to set adUnitId programmatically to ads from the new Google Play services (old AdMob). I have this in XML (used in an ):
Daniel Argüelles
  • 2,229
  • 1
  • 33
  • 56
15
votes
2 answers

How do I show and hide admob banner ads?

Giving another chance to this comunity, my latest questions weren't ever answered Well I have a game, the game have a pause button that hide most of the game interface to just show a pause text in the middle. There are so much free space, so I…
14
votes
3 answers

How to make AdView "occupy" space even while requesting an ad? (Android)

I'm using Google AdMob Ads SDK 4.0.4 for Android By default, The AdView will have no size until the ad is loaded. Which could cause problem if you have buttons above or below the ad. User could accidentally click on the ad if the ad returned at the…
Kitti Wateesatogkij
  • 979
  • 2
  • 12
  • 23
12
votes
2 answers

Admob on Multiple Activities?

I have 7 Activities in my application. I wants to display admob in every activity Whether i have to create each AdView in every activity? or is there any alternative to reuse previous activity container OR prevent it from destroy so can i use in…
MicroEyes
  • 3,680
  • 4
  • 26
  • 35
9
votes
1 answer

Using one AdMob AdRequest for multiple AdViews?

I have an Android app which has a few AdViews and every AdView has its own AdRequest so far. But is it possible/recommendable to use just one AdRequest for every AdView? Does that even make a difference? (Of course it makes a difference, but is it…
Makru
  • 487
  • 1
  • 5
  • 12
8
votes
3 answers

What is the size, in pixels, of AdSize.BANNER?

In my Android app, I have an AdView: AdView adView = new AdView(this, AdSize.BANNER, MY_BANNER_UNIT_ID); How do I get the size of this in pixels?
BenH
  • 2,100
  • 2
  • 22
  • 33
8
votes
1 answer

Admob Security Exception : Permission Denial

I tap on my AdView and open alibaba app page in play store and then installed it. After that, I started to get this error and my app crashed whenever I tap on the AdView. After uninstalling this alibaba app, I was able to tap and view the ads. Now…
Figen Güngör
  • 12,169
  • 14
  • 66
  • 108
8
votes
4 answers

Issues with Loading AdMob Ads on App

I am trying to have an ad banner display on my app and I seem to be having an issue. Anytime I go into the activity, the app crashes and mentions something about that when I am trying to load the ad, that it is a null reference. I am not positive…
sboehnke
  • 287
  • 1
  • 3
  • 13
7
votes
1 answer

Admob requires marketplace url for not published app (need MY_AD_UNIT_ID)

I want to place ads on my new application. I imported the Google Admob SDK but couldn't initiate a new AdView object since it requires "MY_AD_UNIT_ID". To receive my MY_AD_UNIT_ID I have to add my app to admob. Admob requires the maket://-link to…
Wolfen
  • 380
  • 1
  • 5
  • 18
1
2 3
19 20