AdMob APIs and Keywords

Can anyone get relevant ads from the AdMob server when setting up keywords or a search query? My application runs on Android, and I manage to download ads from the AdMob server.

I try several solutions, but they don't seem to work.


Solution 1: use the setKeywords( String keywords ) or setSearchQuery( String searchQuery ) from the AdView class, and then call requestFreshAd() . When the request is currently being executed, the call to requestFreshAd() generates the following log message:

"WARN / AdMobSDK (2541): Ignoring requestFreshAd () because we are requesting an ad right now."

.

Thus, I am trying to call requestFreshAd() when the request is not executing, but it is no longer working.


Solution 2: In the XML layout, use the myapp:keywords="myKeywords" in the AdView element. These attributes were previously declared in the attrs.xml file.

+4
source share
1 answer

The ADMob SDK will automatically request a new addition based on the installed refresh rate. I think the default is 60 seconds. That way you don't have to call requestFreshAd() . Launch the application from Eclipse, go to the action where it is added, and look at the logcat window. Periodically, you will see that the addition is automatically selected based on this update frequency value. You can change this refresh rate http://www.admob.com/my_sites , and then click "Manage Settings" in the application and "Application Settings". Alternatively, you can simply set the refresh interval with the refreshInterval attribute in the AdView element in your layout XML file.

0
source

Source: https://habr.com/ru/post/1340615/


All Articles