Inmobi.com "ad request successful but no ad served" - android

When I try to load an interstitial with inmobi.com and most of the times I get the error "ad request successful but no ad served". Why is this happening? Any solution for this? It works well with testing ads when set to "Test mode" in the website. Will this be because inmobi has not enough providers to display ads at that moment?
I asked Inmobi support page but they don't answer. I am starting to regret moving from admob to inmobi.
This is the code I use:
JSONObject consentObject = new JSONObject();
try {
consentObject.put(InMobiSdk.IM_GDPR_CONSENT_AVAILABLE, true); // Provide correct consent value to sdk which is obtained by User
consentObject.put("gdpr", "1"); // Provide 0 if GDPR is not applicable and 1 if applicable
//consentObject.put(InMobiSdk.IM_GDPR_CONSENT_IAB, “<<consent in IAB format>>”); // Provide user consent in IAB format
} catch (JSONException e) {
}
InMobiSdk.init(this, "My InMobi Account ID here", consentObject);
long MyPlacementID = 1234566789L; //My Placement ID here as long
mInterstitialAd = new InMobiInterstitial(this, MyPlacementID, new InterstitialAdEventListener() {
#Override
public void onAdLoadSucceeded(InMobiInterstitial inMobiInterstitial) {
super.onAdLoadSucceeded(inMobiInterstitial);
if (inMobiInterstitial.isReady()) {
mInterstitialAd.show();
}
#Override
public void onAdLoadFailed(InMobiInterstitial inMobiInterstitial, InMobiAdRequestStatus inMobiAdRequestStatus) {
sError = inMobiAdRequestStatus.getMessage();
Here I get error: "ad request successful but no ad served"
}

I emailed the support team and they answered that is shown if they don't have any ad to be displayed (maybe for my location or for my time). So, it is just that they run out of ads to be displayed. If I try it many many times then I may get one ad. So it is a server problem. Not enough clients to pay for ads. It is a pity.

I was having the same issue.I tried different ways to get the test ads.But everything was in vein.Then i went through their documentation and found that we need to set up a layout for ad placement.There is an option to customize that.Click on save and then add your device id in the testing devices section, you will see test ads coming up.I found this one from an article where it said "If you set banner sizes different from those provided by default, the SDK will refuse to load data and will issue a corresponding message to the log:
[InMobi]: Failed to fetch ad for placement id: 201901231449, reason phrase available in onAdLoadFailed callback.
And the message “Ad request successful but no ad served” with the code “NO_FILL” appears in the listener's method. Hence our expert advice: always redefine the listener's methods which are responsible for errors. Acting such a way, you'll avoid many difficulties later."
https://agilie.com/en/blog/how-to-integrate-inmobi-sdk-to-start-monetizing-your-android-app

Contradicting answer to #Ton's answer.
All the ad servers work in the following manner. Advertisers pay for ads with specific targetted audiences. So whenever you ask an ad network to provide an ad it actually checks if they have an ad for which targeting is matched with the current user (for ex. area, gender, age as and when available). If they don't have any ad which can be shown to the current user then they will fire NO_FILL.
Also, specific to InMobi, they don't provide many ads on emulators so try on a physical device to get ads.

Related

Facebook's NativeAdsManager gives always the same ad

I'm using Facebook's NativeAdManager for Android as intended:
nativeAdsManager = new NativeAdsManager(context, "my_placement_id", 3);
which should load me 3 different ads, and them allow me to get them in my adapter using:
NativeAd adItem = nativeAdsManager.nextNativeAd();
but for some reason I always get the same ad. According to their reference:
The NativeAdsManager provides a mechanism to fetch a set of NativeAds and then use them within your application. The recommended usage is to call nextNativeAd() at the moment when you are about to render an ad. The NativeAdsManager can hold at most 10 unique ads at once but supports giving out as many ads as needed by cloning over the set of NativeAds it got back from the server which can be useful for feed scenarios.
Am I missing something here?

onFailedToRecieveAd(Invalid Ad Request) message with AdMob

I've been trying to get AdMob to work for some time on my app. I keep getting onFailedToRecieveAd(Invalid Ad Request) message in the log. I've paired down my test application to this:
AdView adView;
LinearLayout ll;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
adView = new AdView(this, AdSize.BANNER, "pub-2...............");//inserted my 16 digit pub id here
adView.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL);
ll = new LinearLayout(this);
ll.setOrientation(LinearLayout.VERTICAL);
ll.addView(adView);
setContentView(ll);
AdRequest adRequest = new AdRequest();
adRequest.addTestDevice("3...............");// 16 digits, tried other strings as
// follows:
//for addTestDevice I've tried several numbers, including the 16 digit device
// number given me by my "device id" application, the "0123456789ABCDEF" device number
// given by my console and device windows, the "CECE.........................." 32 digit
// device number my logcat file told me to use in a logcat message,
// "AdRequest.TEST_EMULATOR"
// which an admob example in the docs said to use, "9774d56d682e549c" which another
// admob docs example said to use.
adView.loadAd(adRequest);
I've also tried adView.loadAd(new AdRequest()); using no device id as in another one of the google admob example apps.
nothing has worked to show anything, it's not even creating space for the ad, just the onFailedToRecieveAd(Invalid Ad Request) message in the logcat
I've also included the necessary permissions and "com.google.ads.AdActivity" in the manifest.
Wow, after days of frustration and posts to various forums I've found the answer.
You have to go to your account on the Admob website to set up your specific app for the admob ads and get a new longer publisher number. My publisher number only started with 'pub-......' where my new number is longer and starts with 'ca-app-pub-.......'. I was curious about this from the start when I saw the 'ca-app-pub' preface in an example banner ap.
Nowhere on the Google Admob "Google Mobile Ads SDK" development site in the "banner ads 1" instructions (https://developers.google.com/mobile-ads-sdk/docs/admob/fundamentals?hl=en_US#android) does it mention having to go back to your admob account to set up your specific app for ads and get a new publisher number.
The stupid mistakes are the hardest to fix.
Be carefull with the id, there are 2 codes: the editor number (like this: pub-xxxxxxxxxxxxxxxx) and the other is the banner id (like this: ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx) (this one you need to use)
You need to use the last one, if you use the first doesnt work:)
It is not unusual to get a failed to receive ad. This is a normal message essentially saying that there are no ads to serve for your app at this point in time.
It means that your Admob integration is working, you are getting a response back from the server. As your app sends more requests it will be more likely to receive ad impressions.
Have you tried requesting an ad without setting the test device ID?
adView.loadAd(new AdRequest());
Try adding the following lines of code to get more info about the failure:
// Set AdListener
adView.setAdListener(new AdListener() {
#Override
public void onFailedToReceiveAd(Ad ad, ErrorCode error) {
System.err.println("Ad failed: " + ad.toString() + error.toString());
}
#Override
public void onReceiveAd(Ad ad) {
System.out.println("Ad received: " + ad.toString());
}
});

Admobs seems to allow only test ads to selected devices. Possible to make it generic?

I am using admobs in my android app and would like to test it with selected users on forums , family and friends.
I would like to display the test ads on their devices to avoid issues with conditions.
The doc says:
adRequest.addTestDevice("TEST_DEVICE_ID");// Test Android Device
But as I plan to share to non-tech people, I am pretty sure they won't be able to get their devices ID.
Is there a way to force displaying test ads on any devices?
Thank a lot.
You can use below line
adRequest.setTesting(true);
See I have used like this for testing purpose
AdRequest adRequest = new AdRequest();
adRequest.setTesting(true);
adView.loadAd(adRequest);
I don't know if there is a way to display test ads on select devices, but you could insert a view that has the same dimensions as the ad (50 by 350 I think?) and make it clear that an ad should go there. If you really wanted to you could even make it an image view, take a screen shot of Google's test ad, and create an onClickListener that sends you to Google.com.
This one was the correct answer
https://stackoverflow.com/a/8665279/327402
Not official but at least, that works!
String aid = Settings.Secure.getString(getContext().getContentResolver(), "android_id");
Object obj = null;
try {
((MessageDigest) (obj = MessageDigest.getInstance("MD5"))).update(
aid.getBytes(), 0, aid.length());
obj = String.format("%032X", new Object[] { new BigInteger(1,
((MessageDigest) obj).digest()) });
} catch (NoSuchAlgorithmException localNoSuchAlgorithmException) {
obj = aid.substring(0, 32);
}
adRequest.addTestDevice(obj.toString());

Why does AdMob return NO FILL

I'm using an AdMob view in an android app, but I'm unable to get any ad into the app.
For reference, I've added the view to a ListView as explained by Dan Dyer here
EDIT:
I'm using GoogleAdMobAdsSdk-4.1.1. The release notes of Google AdMob Ads SDK for version 4.1.0 says:
"...
- Added support for AdRequest.addTestDevice() and AdRequest.setTestDevices(). Note that AdRequest.setTesting() is now deprecated.
..."
This is how the ad is inserted to my ListView:
public View getView(int position, View convertView, ViewGroup parent) {
// Some other code
// Reusing convertView etc.
AdView adView =
new AdView((Activity) getContext(), AdSize.BANNER,
"/xxxxxx/ca-pub-xxxxxxx/my_ad_unit");
for (int i = 0; i < adView.getChildCount(); i++) {
adView.getChildAt(i).setFocusable(false);
}
adView.setFocusable(false);
float density = getContext().getResources().getDisplayMetrics().density;
int height = Math.round(50 * density);
AbsListView.LayoutParams params = new AbsListView.LayoutParams(
AbsListView.LayoutParams.FILL_PARENT, height);
adView.setLayoutParams(params);
AdRequest request = new AdRequest();
request.addTestDevice("xxxxxxxxxxxxxxxxx");
adView.loadAd(request);
// other stuff
// returning convertView
}
I've also added an AdListener to the adview, and on every loadAd, the onFailedToReceiveAd callback method is called:
public void onFailedToReceiveAd(Ad arg0, ErrorCode arg1) {
Log.d(TAG, "AdMob in list failed to receive ad: " + arg1.name());
}
In logcat I get this message:
08-17 15:22:18.065: AdMob in list failed to receive ad: NO_FILL
Can anyone tell me what this errorcode means?
To answer the question:
NO_FILL is returned from AdMob when there is no inventory left to
serve in the AdMob/DFP backend.
First of all this meant I was requesting an ad of size AxB, but the backend had no ads of this size left to show. It is important that the size you request has inventory left in the backend systems of AdMob/DFP.
Second, their API states that the first time you request an ad to a specific ad unit, you should expect up to two minutes before the ads start serving. I don't know if it is because I am not stationed in the US, but these two minutes often becomes at least 20 minutes if not several hours for me.
I get a 'No Fill' response when I make a request for ads in the Test or Non-Test Mode. What should I do?
In both the Test and Non-Test modes, depending on various parameters such as server load, non-availability of targeted ads, and so on, the Ad Server may send a No Fill response. Try reloading the ad after some time to keep receiving the ads. Although a No Fill is common in the advertising space, you can write to us with your queries.
http://developer.inmobi.com/wiki/index.php?title=Android
This essentially means there are no Ads currently with AdMob for your FILL request. Run AdMob in test mode and you can see the ad.
request.setTesting(true);
Change the package name of your live app or game in market available..
and use your new admob-id in the project , check once..
androidadmobunityunity3d

How to prevent ad blocker from blocking ads on an app

One of my users let the cat out of the bag and told me they were using one of my free apps, which is monetized by ads, but they were blocking the ads with an ad blocker. They told me this mockingly, as if I can't do anything about it.
Can I do something about it? Is there a way to detect that ads are being blocked?
I am aware of one way that ad blocking works (on any computer really), they edit the hosts file to point to localhost for all known ad servers. For android this is located in the "etc/hosts" file.
For example, I use admob ads and a host file that I have taken from custom rom lists the folowing admob entries:
127.0.0.1 analytics.admob.com
127.0.0.1 mmv.admob.com
127.0.0.1 mm.admob.com
127.0.0.1 admob.com
127.0.0.1 a.admob.com
127.0.0.1 jp.admob.com
127.0.0.1 c.admob.com
127.0.0.1 p.admob.com
127.0.0.1 mm1.vip.sc1.admob.com
127.0.0.1 media.admob.com
127.0.0.1 e.admob.com
Now anytime a process tries to resolve the above addresses they are routed to the address listed to the left of them (localhost) in this case.
What I do in my apps is check this host file and look for any admob entries, if I find any I notify the user that I've detected ad blocking and tell them to remove admob entries from there and do't allow them use of the app.
After all what good does it do me if they're not seeing ads? No point in letting them use the app for free.
Here is a code snippet of how I achieve that:
BufferedReader in = null;
try
{
in = new BufferedReader(new InputStreamReader(
new FileInputStream("/etc/hosts")));
String line;
while ((line = in.readLine()) != null)
{
if (line.contains("admob"))
{
result = false;
break;
}
}
}
I vow that all ad supported apps should check this file. You do not need to be root in order to access it, but writing to it might be a different story.
Also, not sure if there is any other files that act the same on a linux based OS, but at any rate we can always check all of those files.
Any suggestions on improving this are welcome.
Also the app called "Ad Free android" needs root access, meaning that it most likely changes the hosts file in order to achieve its goal.
My code for this issue is thusly: -
try {
if (InetAddress.getByName("a.admob.com").getHostAddress().equals("127.0.0.1") ||
InetAddress.getByName("mm.admob.com").getHostAddress().equals("127.0.0.1") ||
InetAddress.getByName("p.admob.com").getHostAddress().equals("127.0.0.1") ||
InetAddress.getByName("r.admob.com").getHostAddress().equals("127.0.0.1")) {
//Naughty Boy - Punishing code goes here.
// In my case its a dialog which goes to the pay-for version
// of my application in the market once the dialog is closed.
}
} catch (UnknownHostException e) { } //no internet
Hope that helps.
As developers, we need to do the difficult job of empathizing with the users and find a middle ground between punishing the few who try to take advantage and the many who play by the rules. Mobile advertising is a reasonable way to allow someone to use a functional piece of software for free. The users who employ ad blocking techniques could be considered lost revenue, but if you take a look at the big picture, can also be those who spread the word about your application if they like it. A more gentle approach to running on systems with ads blocked is to display your own "house" ad. Create one or more banner images and display them in the same spot as your normal ad with an ImageView of the same height (e.g. 50dp). If you successfully receive an ad, then set your ImageView's visibility to View.GONE. You can even create a timer to cycle through several house ads to get the user's attention. Clicking on your ad can take the user to the market page to buy the full version.
Can you check to see if the ad loaded in your app?
Ad blockers work by preventing your app from downloading data. You could check the content length of the data in your ad frame to make sure there is data there.
If there is no data throw up a message and exit or warn you with an email.
It might not be as big an issue as you think since only a small percentage of people block ads.
The top two answers help you with only a particular (if, probably, the most popular) method of blocking ads. Root users can also block ads with a firewall on the device. WiFi users can block ads with an upstream firewall.
I suggest:
Don't reward ad-blocking users. Ensure that your layout reserves part of the display for an ad even if one can't be loaded. Or if you have a full-screen ad that plays for a bit, ensure that your app waits for a bit even if the ad can't be played. If you use notifications as adverts (you scum), notify the user when you fail to get such an advert. This could be read as "annoy all of your users", but your normal users know what they're getting, and your ad-blocking 'users' aren't wanted.
Ask ad-blockers to stop. The less proftable an industry that supplies what a user wants, the less that industry will supply what the user had wanted. An individual developer will find that he makes more money serving other users. You know this, and your users will think it obvious after you tell them, but it's still an economic argument - it's not intuitive. Have a backup ad that says something like, "This is my job. If you don't pay me, I'll get another one, and you won't get more apps like this from me."
There is nothing you can do that your users can't do better.
The only thing that comes to mind as remotely effective is to make the ads an inextricable part of the program, so that if they're blocked the user cannot make sense of/interact with the application.
Rather than checking for individual software installed or modified hosts file, my approach is using an AdListener like this and, if the ad fails to load due to NETWORK_ERROR, I just fetch some random always-online page (for the kicks, apple.com) and check if the pages loads successfully.
If so, boom goes the app.
To add some code, listener class would be something like:
public abstract class AdBlockerListener implements AdListener {
#Override
public void onFailedToReceiveAd(Ad arg0, ErrorCode arg1) {
if (arg1.equals(ErrorCode.NETWORK_ERROR)) {
try {
URL url = new URL("http://www.apple.com/");
URLConnection conn = url.openConnection();
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
reader.readLine();
onAdBlocked();
} catch (IOException e) {}
}
}
public abstract void onAdBlocked();
}
And then each activity with an adView would do something like:
AdView adView = (AdView) findViewById(R.id.adView);
adView.setAdListener(new AdBlockerListener() {
#Override
public void onAdBlocked() {
AlertDialog ad = new AlertDialog.Builder(CalendarView.this)
.setMessage("nono")
.setCancelable(false)
.setNegativeButton("OK", new OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
System.exit(1);
}
})
.show();
}
});
I think it depends on the content provider for the ads. I know the AdMob SDK provides a callback when an ad request fails. I suspect that you might be able to register for this, then check for a connection in the callback - if there is a connection and you did not receive an ad - take note, if it happens more than once or twice, chances are likely your ads are being blocked. I have not worked with the AdSense for Mobile toolset from Google but it wouldn't surprise me if there was a similar callback mechanism.
There are two ways for a user to by pass a advertisement:
1) Use app without internet on.
2) With rooted phone and modified host file.
I made two tools that you can implement, see code below.
checkifonline(); is for problem 1:
public void checkifonline() {
boolean haveConnectedWifi = false;
boolean haveConnectedMobile = false;
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo[] netInfo = cm.getAllNetworkInfo();
for (NetworkInfo ni : netInfo) {
if (ni.getTypeName().equalsIgnoreCase("WIFI"))
if (ni.isConnected())
haveConnectedWifi = true;
if (ni.getTypeName().equalsIgnoreCase("MOBILE"))
if (ni.isConnected())
haveConnectedMobile = true;
}
if(haveConnectedWifi==false && haveConnectedMobile==false){
// TODO (could make massage and than finish();
}
}
adblockcheck(); is for problem 2
private void adblockcheck() {
BufferedReader in = null;
boolean result = true;
try
{
in = new BufferedReader(new InputStreamReader(
new FileInputStream("/etc/hosts")));
String line;
while ((line = in.readLine()) != null)
{
if (line.contains("admob"))
{
result = false;
break;
}
}
} catch (UnknownHostException e) { }
catch (IOException e) {e.printStackTrace();}
if(result==false){
// TODO (could make massage and than finish();
}
}
This is an extension of a previous answer. The user has informed me that the app they are using is called AdFree Android. It can be found on the market. The app says it works by "nullifying requests to known hostnames serving ads."
I suggest that if you monetize any of your apps with ads, you check at startup for this program and give the user a nasty message, then terminate your app.
First, let me say that I believe that Ad Blocking, when it comes to applications, is actually a form of piracy. These apps are supported by the ads, and sometimes, a "paid license" to turn off ads and/or add features. By blocking ads, users are stealing potential revenue from the developer that took the time to create the app that you are using.
Anyhow, I want to add a way to help prevent the use of Ad Blockers. I use this method and I do not allow users to use the app if I detect an ad blocker. People get very angry and will give you poor ratings for it. But I also state very clearly in my applications descriptions that you will not be able to use the app if you have an adblocker.
I use the package manager to check if a specific package is installed. While this will not get all of the adblockers, if you keep "up to date" on some of the popular ones, you can get most of them.
PackageManager pm = activity.getPackageManager ();
Intent intent = pm.getLaunchIntentForPackage ( "de.ub0r.android.adBlock" );
if ( Reflection.isPackageInstalled ( activity, intent ) ) {
// they have adblock installed
}
Give your users a way to use the app without the ads. I personally find ads one of the most annoying things that could possibly happen on my computer, and I will gladly pay for an application if it spares me the insult of having ads thrown into my face. And I'm sure I'm not the only one.
I'm sure this answer won't be entirely popular with certain segments of developers, however consider if you fall into this category that perhaps your app doesn't deserve to exist on the app store. Please note that these are all implementable as code changes, no hackery or spyware like behavior required.
Basically, change the economics of your app. The User is Always Right - this is the attitude taken by one of the most successful advertising companies ever (Google). If your ads are being blocked by users, its because you suck, not because ads or ad-blockers suck.
http://books.google.com/books/about/The_User_is_Always_Right.html?id=gLjPMUjVvs0C
Make ads less annoying and in-your-face. Users react to poor/annoying advertisement, and the seedier your app looks and becomes, the more likely they are to ditch it anyways. I don't mind apps with ads in them as long as they aren't significantly impeding the functionality, and even better I like ads which are relevant to me. (http://www.nngroup.com/articles/most-hated-advertising-techniques/)
To detect that ads aren't being loaded, its not necessary to implement the spyware like activities mentioned by previous posters. Load an ad that has a confirmation code, and every once in awhile, insert a prompt asking for the confirmation code. The code doesn't have to be long or annoying, in fact it'd be enough to implement a captcha service with 3 or 4 letters/numbers.
(http://textcaptcha.com/api)
In addition to detecting failure of ads to load, make better ads. Instead of using an API like mobads (Do you even realize how seedy that sounds? Mobs? Really? Are we developers, the Russian Mafia?), enter a partnership with an ad company that allows you to embed ads directly from your app. It will make your overall app larger to install, and no, you can't guard against manual modification, but the changes suggested above don't guard against that either. And this will better support any paid versions of your app, which will be much more lightweight (and faster).
Thoroughly vet the ads you are displaying to the user, be open and transparent about your ad policies, and even allow users to inspect your ads and ad sources. The primary reason I'm ever concerned about ads is not because I hate ads, but because I worry that the poor quality developer responsible for this app is letting in viruses or other malware as well. Ask that an exception be made to the installed adblocker. Team up with ad blockers like AdBlock to get on their exceptions list. If you are a legit application, this shouldn't be a problem.
(http://www.cio.com/article/699970/6_Ways_to_Defend_Against_Drive_by_Downloads?page=1&taxonomyId=3089)
I re-iterate: all of the above changes are things you can legitimately do in code to prevent anti-ad behaviors. Ads are blocked for security reasons and visceral reactions, primarily, and sometimes bandwidth and performance, so make sure your ads don't invoke any of these problems, at the code level.
Finally I did want to touch on what Borealid said, which I re-iterated above; in the end it is a 'cat and mouse' game, because the user has ultimate authority and responsibility, both legally and morally, over their own property. A user can do whatever, including directly modify code on the fly. Of course, there are restrictions you can implement etc. but there are always ways to get around the problem. This is the ultimate problem (technically) with DRM (which is what you're trying to do). Rather than waste time and effort on this game, it is better to encourage users to keep ads around; they'll become your best, smartest anti-ad-blockers, for free.
For the case when there is no internet connection, I have followed this
tutorial
and I've build a "network state listener" like so:
private BroadcastReceiver mConnReceiver = new BroadcastReceiver()
{
#Override
public void onReceive(Context context, Intent intent)
{
boolean noConnectivity = intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, false);
if (noConnectivity == true)
{
Log.d(TAG, "No internet connection");
image.setVisibility(View.VISIBLE);
}
else
{
Log.d(TAG, "Interet connection is UP");
image.setVisibility(View.GONE);
add.loadAd(new AdRequest());
}
}
};
#Override
protected void onCreate(Bundle savedInstanceState)
{
//other stuff
private ImageView image = (ImageView) findViewById(R.id.banner_main);
private AdView add = (AdView) findViewById(R.id.ad_main);
add.setAdListener(new AdListener());
}
#Override
protected void onResume()
{
registerReceiver(mConnReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
super.onResume();
}
#Override
protected void onPause()
{
unregisterReceiver(mConnReceiver);
super.onPause();
}
registerReceiver and unregisterReceiver have to be called in onResume and onPause respectively, as described here.
In your layout xml set up the AdView and an ImageView of your own choice, like so:
<com.google.ads.AdView xmlns:googleads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_alignParentBottom="true"
android:id="#+id/ad_main"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
googleads:adSize="BANNER"
googleads:adUnitId="#string/admob_id" />
<ImageView
android:id="#+id/banner_main"
android:layout_centerInParent="true"
android:layout_alignParentBottom="true"
android:layout_width="379dp"
android:layout_height="50dp"
android:visibility="gone"
android:background="#drawable/banner_en_final" />
Now, whenever the internet connection is available the ad will display and when its off the ImageView will pop-up, and vice-versa. This must be done in every activity in which you want ads to display.
As well as checking if admob can be resolved, what I do is present a page that basically advises that I have detected an adblocker, state that i understand the possible reasons why, then show some inbuilt ads of my own apps and ask for their kind support for continued development. :)

Categories

Resources