question

mutantbc avatar image
mutantbc asked

Ads not showing

Hi, when I integrate the ads below, I can't see the ads display. And also the ads linearlayout is on top of my listview which I can only see white screen without the ads and my list of pictures is behind the ads. Please advise how to show the ads and if the ads is not shown, how will I be able to switch back to my view to display e.g. list of pictures. Thanks try { AdRegistration.setAppKey(getApplicationContext(), "xxxxxxxxxxxxxxxxxxxxxxx"); //Amazon Ads: // Programmatically create the AmazonAdLayout this.adView = new AdLayout(this,AdLayout.AdSize.AD_SIZE_320x50); LinearLayout layout = (LinearLayout)findViewById(R.id.mainLayoutId); // Set the correct width and height of the ad. LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT); layout.addView(this.adView,lp); // If you declared AdLayout in your xml you would instead // replace the 3 lines above with the following line //this.adView = (AdLayout) findViewById( R.id.adview ); //testing AdRegistration.enableTesting(getApplicationContext(), true); this.adView.loadAd(new AdTargetingOptions()); // async task to retrieve an ad }catch(Exception e) { e.printStackTrace(); } layout:
mobile ads
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt15@Amazon avatar image
Matt15@Amazon answered
Hey Mutantbc, First, make sure you have followed the proper procedure for obtaining your Application Key. See instructions here: https://developer.amazon.com/sdk/mobileads/quick-start.html#Before%20You%20Use%20the%20Amazon%20Mobile%20Ads%20API You should also make sure that the parent view that you are referencing in your LinearLayout "mainLayoutId" does not have a width or height equal to zero. If it does, avoid setting your dimensions to match_parent. If you're still having problems seeing the ad, please enable logging and copy the logcat messages that appear when the ad attempts to load. Paste the messages into your response. Instructions for enabling logging can be found here: https://developer.amazon.com/sdk/mobileads/testing-your-app.html#Debugging Thanks Matt
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mutantbc avatar image
mutantbc answered
Hi Matt, Thanks. I am getting no ads from a certain ads provider. Is there a way at the api to set and return only have ads? instead of throwing an exception that there is no ads return from the ads provider? Or any suggestion to show the ads if it failed? Is it also possible to show a video ads? 03-12 21:09:37.015: D/AmazonMobileAds AdLoader(7952): Exception caught while loading ad: java.lang.Exception: AAX did not return an ad
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sachin@Amazon avatar image
Sachin@Amazon answered
Hi Mutantbc, Can you please raise a ContactUs ( https://developer.amazon.com/help/contactus.html) with the following section of logcat when the ad load action is attempted? Start from: The line that contains: "Generated AAX url". End at: The error line that contains one of the four error codes, such as INTERNAL_ERROR, that are mentioned here: https://developer.amazon.com/sdk/mobileads/event-tracking-and-errors.html#Errors Note: Please raise a ContactUs with this information and refrain from posting this information on forums.
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mutantbc avatar image
mutantbc answered
Ok noted.
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.