private com.facebook.ads.AdSize getAdSize(com.google.android.gms.ads.AdSize adSize){if ((adSize.getWidth() == com.facebook.ads.AdSize.BANNER_320_50.getWidth()) &&(adSize.getHeight() == com.facebook.ads.AdSize.BANNER_320_50.getHeight())) {return com.facebook.ads.AdSize.BANNER_320_50;}if ((adSize.isFullWidth()) &&(adSize.getHeight() == com.facebook.ads.AdSize.BANNER_HEIGHT_50.getHeight())) {return com.facebook.ads.AdSize.BANNER_HEIGHT_50;}if ((adSize.isFullWidth()) &&(adSize.getHeight() == com.facebook.ads.AdSize.BANNER_HEIGHT_90.getHeight())) {return com.facebook.ads.AdSize.BANNER_HEIGHT_90;}return null;}
32 - phones in landscape50 - phones in portrait90 - tablets in either orientation private int convertSize(Context context, int s) { return (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, s, context.getResources().getDisplayMetrics()); }
private com.facebook.ads.AdSize getAdSize(Context c, AdSize adSize) { if (adSize.getWidthInPixels(c) == convertSize(c, com.facebook.ads.AdSize.BANNER_320_50.getWidth()) && adSize.getHeightInPixels(c) == convertSize(c, com.facebook.ads.AdSize.BANNER_320_50.getHeight())) return com.facebook.ads.AdSize.BANNER_320_50; if (adSize.isFullWidth() && adSize.getHeightInPixels(c) == convertSize(c, com.facebook.ads.AdSize.BANNER_HEIGHT_50.getHeight())) return com.facebook.ads.AdSize.BANNER_HEIGHT_50; if (adSize.isFullWidth() && adSize.getHeightInPixels(c) == convertSize(c, com.facebook.ads.AdSize.BANNER_HEIGHT_90.getHeight())) return com.facebook.ads.AdSize.BANNER_HEIGHT_90; else return null; }The height of your ad is based on your device’s height, as the following table indicates:
| Device height | Ad height |
|---|---|
| h < 400 dp | 32 dp |
| 400 dp <= h < 720 dp | 50 dp |
| h >= 720 dp | 90 dp |
Height is dependent on the device’s current orientation. In general, you'll see:
We run into the same issue. Where do you get the sources of the adapter?
--
---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
private com.facebook.ads.AdSize getAdSize(Context c, AdSize adSize) returns null
com.facebook.ads.AdSize facebookAdSize = getAdSize(context, adSize);
if(facebookAdSize == null){ Log.w(TAG, "The input ad size is not supported at this moment."); mBannerListener.onAdFailedToLoad(this, 3); return;} else{
....--
---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/MWoBWBR0FQM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
Hi Andrew,The attached files are log from my android app and the session log from Charles Proxy when asking for ads from adomb. In my understanding, the app never gets a chance to get ad content from facebook because it thinks the ad size won't fit when receiving ad info from admob. I could be wrong, but I don't anything helpful from session log. The think I really don't understand is that why we would have to convert ad size ourselves. Shouldn't the sdk or adapter take care of that? By the way, my adsize is SmartBanner in the app.
2015-02-11 1:59 GMT+08:00 <google-admob-ads-sdk@googlegroups.com>:
Would either of you be able to get a log of the requests and responses from Facebook, so I can see exactly what's going on with their traffic? You can use a local proxy like Charles Proxy or Fiddler for this. We don't have access to Facebook's SDK source code, which makes it difficult for me to get an accurate view of the situation and help.-Andrew
On 02/10/15 07:32:43 mr.bet...@googlemail.com wrote:
We run into the same issue. Where do you get the sources of the adapter?
--
---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/MWoBWBR0FQM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
--
--
Hi Andrew,I just downloaded the new Facebook adapter and tried it on my app. However, I still could not load any facebook ads by using SMART_BANNER. I do notice that the change log said the the smart banner is supported now. I find the following messages from my debug app. In our app, we use https for security because our server also use https. Is this why I cannot load the smart banner ads?03-11 09:00:44.328 24773-24773/xxxxxxxxx W/Ads﹕ JS: The page at 'https://pubads.g.doubleclick.net/gampad/ads' was loaded over HTTPS, but ran insecure content from 'http://googleads.g.doubleclick.net/mads/static/formats/templates.js': this content should also be loaded over HTTPS.03-11 09:00:44.328 24773-24773/xxxxxxxxx I/chromium﹕ [INFO:CONSOLE(0)] "The page at 'https://pubads.g.doubleclick.net/gampad/ads' was loaded over HTTPS, but ran insecure content from 'http://googleads.g.doubleclick.net/mads/static/formats/templates.js': this content should also be loaded over HTTPS.", source: https://pubads.g.doubleclick.net/gampad/ads (0)
To unsubscribe from this group and all its topics, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.