Admob Native Ads

165 views
Skip to first unread message

Zayn Javadd

unread,
May 8, 2020, 7:11:04 PM5/8/20
to google-adm...@googlegroups.com
hi, can someone send me sample code on adding admob native ads ads? I decided to add native ads. (into recyclerview) but any source did not help me. because he constantly calls ArrayList as an object in these narratives .. please give me a more detailed tutorial. I examined this but it didn't happen:  https://codelabs.developers.google.com/codelabs/admob-native-advanced-feed-android/#0

Mobile Ads SDK Forum Advisor Prod

unread,
May 10, 2020, 9:05:37 PM5/10/20
to zaynja...@gmail.com, google-adm...@googlegroups.com

Hi Zayn,

 

Thank you for reaching out to us.

 

The example code you've linked is the best example we could provide for implementing AdMob native ads into a RecyclerView. Could you kindly clarify on what your concern is with the code? You may provide any sample project (that you've already done) to us (via Reply privately to author) so that we can more closely investigate your concerns.

 

Regards,

Ziv Yves Sanchez

Mobile Ads SDK Team



ref:_00D1U1174p._5004Q1zL1WZ:ref

Zayn Javadd

unread,
May 11, 2020, 7:10:25 PM5/11/20
to Google Mobile Ads SDK Developers
Thank you for reply!
As seen here;

private List<Object> mRecyclerViewItems = new ArrayList<>();


 ArrayList is returned as an object. so I'm having trouble adding native ad to that ArrayList. because my array list is just a simple POJO class (i'm fetching id, name, picture urls with volley)


11 Mayıs 2020 Pazartesi 04:05:37 UTC+3 tarihinde mobileadssdkforumadvisor yazdı:

Mobile Ads SDK Forum Advisor Prod

unread,
May 11, 2020, 8:58:46 PM5/11/20
to zaynja...@gmail.com, google-adm...@googlegroups.com

Hi Zayn,

 

Thank you for clarifying your concern.

 

It seems that your concern lies more on the implementation side of Android, using Volley to replace the generic ArrayList with a POJO version of itself. With this in mind, I'm afraid that such Android-specific libraries are out-of-scope with the level of assistance that we can provide on this forum. You may want to reach out to more Android-development-centric forums, such as StackOverflow, for further assistance on this.

Zayn Javadd

unread,
May 12, 2020, 9:40:32 AM5/12/20
to Google Mobile Ads SDK Developers
my problem is all about admob. it's not really revealing. Instead, I can put a null object in the recyclerview after every 5 items (if%5==0{list.add(null);}), and then I place a banner ad on the adapter if there is a null object. I can issue a command, but local ads aren't. The information provided is not really descriptive!

12 Mayıs 2020 Salı 03:58:46 UTC+3 tarihinde mobileadssdkforumadvisor yazdı:

Mobile Ads SDK Forum Advisor Prod

unread,
May 12, 2020, 10:27:41 AM5/12/20
to zaynja...@gmail.com, google-adm...@googlegroups.com
Hi there,

Are you trying to place banner ads in the RecyclerView? Native Ads? Or are you trying to place a banner ad if Native Ad didn't load yet? The sample project loads 5 Native Ads and it seems like you want to load an ad every 5 spaces. Could you explain in depth your use case so that we may address it accurately if it's a Mobile Ads SDK issue? Off the cuff, maybe having 3 types of RecyclerView item types - one for content, a second for Native Ads and a third for Banner Ads and just hide the ones that don't load would address your use case. We have an example of RecyclerView with Banner Ads implementation here - https://github.com/googleads/googleads-mobile-android-examples/ - just look in java - advanced.

Kind Regards,
Aryeh Baker

Zayn Javadd

unread,
May 12, 2020, 2:39:32 PM5/12/20
to Google Mobile Ads SDK Developers
I'm trying to add native ads. what I mean is this; It is easier to add banner ads to recyclerview than to add native ads.

https://pastebin.pl/view/e9eeb0c2

recyclerview adapter: https://pastebin.pl/view/c40b12f0

I use this to add banner ads. it's really simple, but if if it's true this "banned" causing wrong click. what I would like to say; it should be as easy as adding this  for native ad

12 Mayıs 2020 Salı 17:27:41 UTC+3 tarihinde mobileadssdkforumadvisor yazdı:

Mobile Ads SDK Forum Advisor Prod

unread,
May 12, 2020, 11:30:36 PM5/12/20
to zaynja...@gmail.com, google-adm...@googlegroups.com

Hi Zayn,

 

Thank you for providing additional details on your concern.

 

Could you kindly provide a sample project (via Reply privately to author), showing what you've done so far with regard to implementing RecyclerView native ads? We'll use the project you'll provide to further investigate the way you've implemented the native ads thus far, and to hopefully provide suggestions on how to continue implementing them going forward.

 

Regards,

Ziv Yves Sanchez

Zayn Javadd

unread,
May 13, 2020, 5:50:17 AM5/13/20
to google-adm...@googlegroups.com
I managed to add it. but i keep getting onAdFailedToLoad error. errorCode: 3 why is this happening? I didn't change anything. now it says error code 0. bullshit! It is necessary to make really explanatory and proper examples.. look: https://stackoverflow.com/questions/56587320/how-to-solve-admob-error-failed-to-load-ad-0 1 year has passed over the questions but nobody answered. if this doesn't happen, i will start using facebook ads soon

13 Mayıs 2020 Çarşamba 06:30:36 UTC+3 tarihinde mobileadssdkforumadvisor yazdı:

Mobile Ads SDK Forum Advisor Prod

unread,
May 13, 2020, 8:21:48 AM5/13/20
to zaynja...@gmail.com, google-adm...@googlegroups.com
Hi Zayn,

To investigate this error on our end could you send via "Reply privately to author" your app Id, ad unit Id affected and app bundle Id? Also could you confirm if test ads or enable test devices work? This information will narrow down the issue.

Kind Regards,
Aryeh Baker

Zayn Javadd

unread,
May 13, 2020, 10:00:01 AM5/13/20
to google-adm...@googlegroups.com
there are dozens of people with problems. and still has no solution. you're just embroidering us...sending you the code will not change anything! by the way, all other ads are working!
native ad load code here: https://pastebin.pl/view/ce562eea

13 Mayıs 2020 Çarşamba 15:21:48 UTC+3 tarihinde mobileadssdkforumadvisor yazdı:

Mobile Ads SDK Forum Advisor Prod

unread,
May 13, 2020, 11:00:45 AM5/13/20
to zaynja...@gmail.com, google-adm...@googlegroups.com
Hi Zayn,

Please note that many app publishers have achieved success and unfortunately you get to see the issues on this forum and not the success stories.
Error code 3 happens when there's a lack of ad inventory for your ad unit Id. Usually this error can only occur after you have correctly implemented the Mobile Ads SDK and this forum can only support the implementation of the Mobile Ads SDK into apps. The AdMob Help Forum addresses ad inventory.

I have heard of some general tips to help with ad inventory for those who are just starting to publish apps and here's a list:
  • to setup tax info, name and address and phone number in your AdMob Account with verification if applicable
  • to publish your app on Google PlayStore and set up an app-ads.txt on your apps website - https://support.google.com/admob/answer/9363762?hl=en
  • to fill out as soon as possible whenever you reach a revenue threshold all the payment details you can fill out in your AdMob Account at that revenue threshold - https://support.google.com/admob/answer/2772208, video describing thresholds
  • to have in mind what would tempt more advertisers to rent space on your app

If you would like for me to confirm what you are seeing could you send to me via "Reply privately to author" your app Id, ad unit Id's affected and app bundle Id?

I wish you a successful app monetization journey and if you ever experience a Mobile Ads SDK implementation issue we would like to hear from you.

Kind regards,
Message has been deleted
Message has been deleted

Zayn Javadd

unread,
May 13, 2020, 11:52:08 AM5/13/20
to google-adm...@googlegroups.com
I get an error code 0 error. Why does this happen?  https://pastebin.pl/view/547a860c

9 Mayıs 2020 Cumartesi 02:11:04 UTC+3 tarihinde Zayn Javadd yazdı:
Message has been deleted

Mobile Ads SDK Forum Advisor Prod

unread,
May 13, 2020, 1:38:39 PM5/13/20
to zaynja...@gmail.com, google-adm...@googlegroups.com

Hi Zayn,

I downloaded and compiled the RecyclerView sample and the app worked on a device and in a simulator. I looked at the code you sent that shows errors slightly differently that the code in the sample and regular implementation shouldn't be affected. I noticed you edited your previous posts and added that you were experiencing an error code 0. My last response was to your reception of error code 3. This article, https://support.google.com/admob/thread/3494603?hl=en states:

This indicates that something happened internally; for instance, an invalid response was received from the ad server. Newly created Ad Units can take up to 2 hours to become active (SpinUp Time). Any Ad requests from newly created Ad Units would also receive Error Code 0 in response to Ad requests until they are ready to serve live ads. What to do? Test Ads!!

Because of your frequent editing of your posts I'm having trouble telling where you are holding in your attempt to get the project working. I have some questions to help clarify:
  • Were you able to compile the sample without modification and succeed in seeing the ads?
  • Are you receiving error codes anymore?
  • Are you using test ads or your own app Id and ad unit Id? 
  • Do you need implementation help?
  • Have you been able to achieve a working RecyclerView with your list from Volley casting your POJO's to generic objects and following the guide otherwise?
It looks like you already solved some things and I'm here to help if there is an SDK implementation issue.
Message has been deleted

Zayn Javadd

unread,
May 13, 2020, 2:11:37 PM5/13/20
to google-adm...@googlegroups.com
When I reply to this message, it is deleted immediately. I did not understand why. Anyway, I say it's impossible to happen. because I'm just trying the test ad and the listener is dropping to onFailed  

public void onAdFailedToLoad(int errorCode) 
   Log.d("TAG_NATIVE", "failed " + errorCode); // out: 0
          if (!adLoader.isLoading()) {
                  insertAdsInMenuItems();

              }
}

9 Mayıs 2020 Cumartesi 02:11:04 UTC+3 tarihinde Zayn Javadd yazdı:
hi, can someone send me sample code on adding admob native ads ads? I decided to add native ads. (into recyclerview) but any source did not help me. because he constantly calls ArrayList as an object in these narratives .. please give me a more detailed tutorial. I examined this but it didn't happen:  https://codelabs.developers.google.com/codelabs/admob-native-advanced-feed-android/#0

Mobile Ads SDK Forum Advisor Prod

unread,
May 13, 2020, 3:16:05 PM5/13/20
to zaynja...@gmail.com, google-adm...@googlegroups.com
Hi Zayn,

I tried this sample app and wasn't able to reproduce this error with test ads. Could you confirm that in a clean build of this sample app you are not getting ads - and that the error you receive is error code 0? You don't have to add your own logic - you can see it in the logcat.

Regards,
Message has been deleted
Message has been deleted

Zayn Javadd

unread,
May 13, 2020, 4:22:04 PM5/13/20
to google-adm...@googlegroups.com
I got it constantly error 0 in logcat, when  I call this code; 


Log.
d("TAG_NATIVE", "failed " + errorCode); // out: 0

9 Mayıs 2020 Cumartesi 02:11:04 UTC+3 tarihinde Zayn Javadd yazdı:
hi, can someone send me sample code on adding admob native ads ads? I decided to add native ads. (into recyclerview) but any source did not help me. because he constantly calls ArrayList as an object in these narratives .. please give me a more detailed tutorial. I examined this but it didn't happen:  https://codelabs.developers.google.com/codelabs/admob-native-advanced-feed-android/#0

Mobile Ads SDK Forum Advisor Prod

unread,
May 13, 2020, 5:09:18 PM5/13/20
to zaynja...@gmail.com, google-adm...@googlegroups.com
Hi Zayn,

Let me consult with the rest of my team. I will get back to you as soon as we have more information.

Kind regards,

Zayn Javadd

unread,
May 13, 2020, 7:28:52 PM5/13/20
to Google Mobile Ads SDK Developers
I'm waiting impatiently.


9 Mayıs 2020 Cumartesi 02:11:04 UTC+3 tarihinde Zayn Javadd yazdı:
hi, can someone send me sample code on adding admob native ads ads? I decided to add native ads. (into recyclerview) but any source did not help me. because he constantly calls ArrayList as an object in these narratives .. please give me a more detailed tutorial. I examined this but it didn't happen:  https://codelabs.developers.google.com/codelabs/admob-native-advanced-feed-android/#0

Zayn Javadd

unread,
May 14, 2020, 6:48:41 PM5/14/20
to Google Mobile Ads SDK Developers
I have run a different activity today. (not main activity) and again no ads were shown. I received the error code 3 error in logcat in the onAdFailedToLoad method. I really do not understand. please review it. everything you need is here .. https://github.com/theoyuncu8/nativetest  After then I have to add this into recyclerview. I also want to ask one more question Is it legal to add banner ads into recyclerview? I saw examples in github but this is said to be forbidden


9 Mayıs 2020 Cumartesi 02:11:04 UTC+3 tarihinde Zayn Javadd yazdı:
hi, can someone send me sample code on adding admob native ads ads? I decided to add native ads. (into recyclerview) but any source did not help me. because he constantly calls ArrayList as an object in these narratives .. please give me a more detailed tutorial. I examined this but it didn't happen:  https://codelabs.developers.google.com/codelabs/admob-native-advanced-feed-android/#0
Reply all
Reply to author
Forward
0 new messages