Should the ad banner displayed as soon as I put the codes? - android

I Applied all steps given to me by Admob to enable ads on my android app ,
but I didn't really register (or give full information) in Adsense ,
so , when I run my app with (Test Banner Id ) then the ads are displayed.
but when I run my app with (Banner Id that given to me by admob) then the ads are not displayed .
is that normal ??
or I have problem ?

You can check whether your real admob working or not by adding your device as test device(By default all emulators are considered as test device).
Add your test device
Load your ads-integrated app and make an ad request.
Check the logcat output for a message that looks like this:
I/Ads: Use AdRequest.Builder.addTestDevice("33BE2250B43518CCDA7DE426D04EE232")
to get test ads on this device.
Copy your test device ID to your clipboard.
Modify your code to call AdRequest.Builder.addTestDevice() with your test device ID. This method can be called multiple times for multiple devices.
AdRequest request = new AdRequest.Builder()
.addTestDevice("33BE2250B43518CCDA7DE426D04EE232")
.build();
If ads are visible on your test device with real id then no problem otherwise you have to check.
Note: Be sure to remove the code that sets these test devices before you release your app.

Related

Do i need to first request a real Ad to get the Device ID from the logcat so i can add a testdevice?

In the documentation it says you should add a test device this way.
But to get this ID from the logcat do i have to first Request a real ad? Isn't that against their own policy to request real ads?
Add your test device
Load your ads-integrated app and make an ad request. Check the logcat
output for a message that looks like the one
below, which shows you your device ID and how to add it as a test
device:
I/Ads: Use
AdRequest.Builder.addTestDevice("33BE2250B43518CCDA7DE426D04EE231") to
get test ads on this device."
There are a) test ad units, which one can use and b) it knows when it is running in debug mode.
This message likely shows in the log before showing any ad unit, but when instancing the client.

How can I get the device string of a physics phone?

In order not to violate policy of Google AdMob AD, I add my physics phone to test device using Code A.
I get the device string "Samsung SM-J5008" of the physics phone using the following UI when I select a device to run the App.
I don't know whether the string "Samsung SM-J5008" is correct, and more the Google AD is still displayed even if I have added the code .addTestDevice("Samsung SM-J5008")
And More
I don't need to remove addTestDevice() when I publish my app, all physical phones will display AD except these physical phones who's name string listed in addTestDevice(), is it right?
Code A
val adRequest = AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addTestDevice("Samsung GT-I9268")
.addTestDevice("Samsung SM-J5008")
.build()
adView.loadAd(adRequest)
When you run the project, if you monitor the LogCat, you can find a similar line Use AdRequest.Builder.addTestDevice(“C04B1BFFB0774708339BC273F8A43708”) to get test ads on this device. Copy the device id and add it to AdRequest.
Note that this ID varies from device to device, By doing this, the test ads will be loaded instead of live ads.
In production you need to make sure that you removed addTestDevice() methods in order to render the live ads and start monetization.
If you are running admob ads on an emulator then there is no ID. just use the AdManager method and set it to TEST_EMULATOR like the logcat says. If you run on an actual device with usb debugging and watch the logcat, the ID will appear in there.You need to add device ID As :
String android_id = Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID);
String deviceId = md5(android_id).toUpperCase();
Log.i("device id=",deviceId);

Google AdMob Code Issue (Running Live Mode ?!)

I signed up for Google AdMob services recently and been using this code to create the AdRequest.
private AdRequest createAdRequest()
{
return new AdRequest.Builder()
.AddTestDevice(AdRequest.TestDeviceSimulator)
.AddTestDevice("0123456789ABCDEF0123456789ABCDEF")
.AddKeyword("game")
.SetGender(Gender.Male)
.SetBirthday(new DateTime(1985, 1, 1))
.TagForChildDirectedTreatment(false)
.AddExtra("color_bg", "9B30FF")
.Build();
}
When logging in today morning, I saw some impression (around 100) created obviously by myself. The TestDevice ID is of course not the correct ID because I was too lazy to find out the correct one.
Are the ads showing right now in my app "real" ads? Can I fix this by adding the correct device ID and will I see then inside App that the Ads are just "Demo"?
... Is there no "general testing-mode" ? I'm developing together with a friend and he has of course a different device ID...
Thanks in advance
You can add multiple device IDs, no problem:
.AddTestDevice("YOURDEVICEIDYOURDEVICEIDYOURDEVICEID")
.AddTestDevice("FRIENDSDEVICEIDFRIENDSDEVICEIDFRIEND")
.AddTestDevice("SOMEONEELSESOMEONEELSESOMEONEELSESOM")
Now your friends and you will see demo ads, all the rest will see real ads.
To get the device id you can start your app and check the logcat for an admob log that looks more or less like this:
05-20 20:27:20.888: I/Ads(32367): Use AdRequest.Builder.addTestDevice("BANANANAANANANANANANNANANANANANA") to get test ads on this device.
Just use this id as a parameter in the addTestDevice method then. See also this related admob question

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 Admob testmode : No fill. Server replied that no ads are available

I followed the admob SDK tutorial to set up ads for my android application.
But I get no test adds returned :(. Also, on the admob site no requests are registered.
When I run my app the log says the following :
03-18 08:23:56.392: INFO/AdMobSDK(1278): Publisher ID set to xxxxxxxx
03-18 08:23:56.392: INFO/AdMobSDK(1278): Making ad request in test mode
03-18 08:23:56.513: INFO/AdMobSDK(1278): No fill. Server replied that no ads are available (120ms)
The xxx is my publisher Id, but I hid it here with x'es :).
I did set my publisher id in the manifest.
I did set the "setTestDevices method" in my code with the device id the logcat requested
AdManager.setTestDevices( new String[] { "xxxxxxxxxxxxxxxxxxxx", } );
What did I do wrong?? I should get test ads on my phone I suppose?
I find AdMob's test mode to be very unreliable. Sometimes I get no ad, sometimes a test ad, and occasionally real ads show.
I'd not worry about it too much, and instead make sure that ads are showing on the live app. you may want to look at Adwhirl if you don't get ads showing. A fill-reate error basically means AdMob didn't sell all the ad space, so if you want ads to always be shown you may need to look beyond AdMob. Adwhirl is an aggregator, owned by AdMob, so it'll pull ads from other networks if they don't have an ad.

Categories

Resources