android AD not shown if testdevice is added - android

AdView adView = (AdView)v.findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice("device#")
.build();
adView.loadAd(adRequest);
I didnt include my actual device number (idk does it have to be a secret?) but I have it.
Anyhow this is my code and whenever i comment out the addTestDevice part i see the ads in my real device, but I dont see them when i have the addTestDevie part.
I dont think this is the way it supposed to be. My device should display the ads but ads should not be clikable. Any solution?

NB there is no value is hiding your your device ID AFAIK.
When you use addTestDevice you should see test ads. They tend to be quite different to real ads. Ie they say things like "Test ad" etc. And you should be able to click on them.

Related

Admob with designed for families not showing ads

I want to add my app to "Designed for families", but for mixed audience, so as official documentation said I change my ads request like this:
Bundle extras = new Bundle();
extras.putBoolean("is_designed_for_families", true);
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addNetworkExtrasBundle(AdMobAdapter.class, extras)
.tagForChildDirectedTreatment(true)
.build();
The problem is that when I put the "is_designed_for_families" extra, no ads is displayed.
W/Ads: Failed to load ad: 3
Update: I know that error 3 means that admob doesn't have an ad to show at the moment, but I have set "test device" so it should show test ads.
I haven't marked as "Designed for families" in Google Play yet, because I want to check that the ads are displaying correctly.
Any ideas about what is happening?
Error code 3 means that admbob doesn't have an ad to show at the moment.
This means that your code implementation is correct but at the moment there are no ads to show.
Also, if you have just implemented admob, it could take some time for it to start sending you ads. This is called "Warming up" and it could take up to a couple of days (depending on the number of ad requests).
Update: If you receive a NO FILL error (code: 3) while testing "Designed for families" ads, the test ad will not be shown.
To test if your admob implementation works, just remove the extra "is_designed_for_families".
This is the intended behaviour of the admob sdk. Source
You can change AdMob with another because AdMob look at your app settings in the play store and check if its a "familey" app
see this website
https://www.quora.com/Which-is-a-better-alternative-to-AdMob-for-Android-ad-platform

Admob Interstitial Ad showing black with new Ad unit ID

i have created one app and i am using admob Interstitial Ads.
As i have created new Interstitial Ad unit ID for that app but ad is showing black with close button, but if i use my old applications Ad unit ID ads will show up.
I dont know why this issue is happening?
Thanks.
For a newly created ad unit it may take some time before getting live ads. Add your device as a test device and check with test ads. They should render fine.
AdRequest request = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR) // All emulators
.addTestDevice("AC98C820A50B4AD8A2106EDE96FB87D4") // An example device ID
.build();
This happened to me (the cross didn't even appear) and I have the Internet permission missing in the Manifest:
<uses-permission android:name="android.permission.INTERNET" />
I think there are a lot of reasons why this happens.

Should I get device ID for Admob when i publish my add

AdRequest adRequest = new AdRequest.Builder()
addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
addTestDevice("HASH_DEVICE_ID")
build();
I just use my device ID or How can i remove test mode and use the Correct mode
-How can I change it ?
No, you don't need to remove this
addTestDevice(AdRequest.DEVICE_ID_EMULATOR) addTestDevice("HASH_DEVICE_ID");
It has been provided in such a way that only the emulator and your own devices will get test ads. For Example I use my apps even after releasing them and i always keep this code included. I download app on my devices again from play store and use them. It shows test ads only on my device (and the devices whose Device ID I have included). So all other users in the world get Real ad impressions.
Welcome,
You will put the Device ID of the AVD emulator where you want to test if Admob works, I have an app using Admob with the Device ID of my emulator test mode and it works fine on real devices. It doesn't show the test banner. But if you want to quit it then your code will look like this:
AdRequest adRequest = new AdRequest.Builder().build();

Android only one admob ad is showing

I recently got the admob ads working correctly, I tested it through:
AdRequest adRequest = new AdRequest.Builder()
//.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
//.addTestDevice("INSERT_YOUR_HASHED_DEVICE_ID_HERE")
.build();
The .addtestDevice worked for the Adrequest.DEVICE_ID_EMULATOR. I received a test ad when that was not in comments. I took it out because I just wanted to see what would happen. I am only seeing one ad being displayed and refreshed constantly. Is there a way to have different ads be shown?
If you mean you're only seeing one live add, that's up to google (or your other providers) as to which ad is being shown. See ADMOB application showing only one add always, how to change the advertisements?

Configure admob test mode

I've just added an AdMob banner in my test app and I'm afraid it's not in "test mode". I mean, this is my code:
adView = (AdView) rootView.findViewById(R.id.main_adview);
// Create an ad request. Check logcat output for the hashed device ID to
// get test ads on a physical device.
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addTestDevice("XXXXXXXX")
.build();
// Start loading the ad in the background.
adView.loadAd(adRequest);
I took the device id from logcat and replaced in the "XXX" text. The problem is: ads are not showing. I found some guys saying that ads may take a long time to start showing in test mode. I'm pretty much ok with that.
My question is : AdMob is showing 2 impressions in the admin panel. How is that possible? The app was not published and I added my device as a test one. I did not changed anything in the admob admin panel to 'enable test mode', should I?
I'm affraid Google will consider this just like I'm cheating.
Thanks a lot!
Don't sweat it. Google is not going to crush you for 2 aberrant impressions. Click on it lots and that's another story.

Categories

Resources