阿德惠尔Millenial Media 广告尺寸 - 太长

发布于 2024-12-26 10:14:13 字数 2016 浏览 1 评论 0原文

我在 Adwhirl 中展示广告时遇到一些问题。

我在那里展示 Millenial Media 和 Admob 广告。

Admob 看起来不错,但是当加载 MM 广告时,看起来广告太长了。

我试图通过某些方式修复它,但无法修复它。

这是我的 Adwhirl 的 Java 代码:

LinearLayout layout = (LinearLayout) findViewById(R.id.layout_main);

AdWhirlLayout adWhirlLayout = new AdWhirlLayout(this, "apid");
RelativeLayout.LayoutParams adWhirlLayoutParams = 
                 new RelativeLayout.LayoutParams(
                        LayoutParams.FILL_PARENT,
                        LayoutParams.WRAP_CONTENT);
int diWidth = 320;
int diHeight = 53;

float density = getResources().getDisplayMetrics().density;

adWhirlLayout.setMaxWidth((int)(diWidth * density + 0.5f));
adWhirlLayout.setMaxHeight((int)(diHeight * density + 0.5f));

layout.addView(adWhirlLayout, adWhirlLayoutParams);
layout.invalidate();

如果有人知道如何修复它,请帮忙。

编辑:

我正在研究 HTC Desire,还尝试在 xml 中创建 adwhirl 布局,但仍然存在同样的问题;(

我尝试将 MM 布局添加到 xml 并使用参数 app:width="320" 它看起来不错。默认值为 480并且使用此值,广告看起来类似于 adwhirl 实现(太长)

xmlns:app="http://millennialmedia.com/android/schema"

<com.millennialmedia.android.MMAdView
android:id="@+id/mmadview" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content"
app:apid="28911"
app:adType="MMBannerAdTop"
app:refreshInterval="30"
app:accelerate="true"
app:ignoreDensityScaling="false"
app:age="46"
app:gender="female"
app:zip="90210"
app:income="85000"
app:keywords="moms,shopping,groceries"
app:ethnicity="hispanic"
app:orientation="straight"
app:marital="married"
app:children="2"
app:education="college"
app:politics="libertarian"
app:height="60"
app:width="480" /> <------------------------------------HERE 

也许有可能在 adwhirl 布局中设置此值

编辑 2:

看起来有问题 ? 480x800 设备分辨率。我在 QVGA 320x240 模拟器上调试应用程序,广告看起来相当不错。

编辑 3:

它看起来像链接中的图像:Adwhirl 布局中的 MM 广告太长

当广告时似乎我可以看到水平滚动条,并且我认为我只能看到这些广告的 2/3

I have some problem with ads showing in Adwhirl.

I'm showing Millenial Media and Admob ads there.

Admob is looking pretty good but when MM ad is loaded it looks that the ad is too long.

I was trying to fix it in some ways but couldn't repair it.

Here is my Java code for Adwhirl:

LinearLayout layout = (LinearLayout) findViewById(R.id.layout_main);

AdWhirlLayout adWhirlLayout = new AdWhirlLayout(this, "apid");
RelativeLayout.LayoutParams adWhirlLayoutParams = 
                 new RelativeLayout.LayoutParams(
                        LayoutParams.FILL_PARENT,
                        LayoutParams.WRAP_CONTENT);
int diWidth = 320;
int diHeight = 53;

float density = getResources().getDisplayMetrics().density;

adWhirlLayout.setMaxWidth((int)(diWidth * density + 0.5f));
adWhirlLayout.setMaxHeight((int)(diHeight * density + 0.5f));

layout.addView(adWhirlLayout, adWhirlLayoutParams);
layout.invalidate();

If someone know how to fix it please help.

EDIT:

I'm working on HTC Desire and also tried to create adwhirl layout in xml and still same issue ;(

I tried to add MM Layout to xml and with parameter app:width="320" it looks good. Default it is 480 and with this value the ad looks similar to adwhirl implementaion (too long)

xmlns:app="http://millennialmedia.com/android/schema"

<com.millennialmedia.android.MMAdView
android:id="@+id/mmadview" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content"
app:apid="28911"
app:adType="MMBannerAdTop"
app:refreshInterval="30"
app:accelerate="true"
app:ignoreDensityScaling="false"
app:age="46"
app:gender="female"
app:zip="90210"
app:income="85000"
app:keywords="moms,shopping,groceries"
app:ethnicity="hispanic"
app:orientation="straight"
app:marital="married"
app:children="2"
app:education="college"
app:politics="libertarian"
app:height="60"
app:width="480" /> <------------------------------------HERE 

Maybe there is some possibility to set this value in adwhirl layout?

EDIT 2:

It looks that there is problem with 480x800 devices resolution. I debuged app on QVGA 320x240 emulator and ad looks pretty nice.

EDIT 3:

It looks like on image in link: Too long MM ad in Adwhirl Layout

When ad appears i can see horizontal scrollbar and i think that I can see only 2/3 of these ads

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

奶气 2025-01-02 10:14:13

我想知道尝试计算宽度和高度是否存在问题。请尝试使用以下基本代码片段:

LinearLayout layout = (LinearLayout) findViewById(R.id.layout_main);
AdWhirlLayout adWhirlLayout = new AdWhirlLayout(this, "apid");
layout.addView(adWhirlLayout);

更新:

您还可以通过 XML 创建 AdWhirlLayout。

<com.adwhirl.AdWhirlLayout
    android:id="@+id/adwhirl_layout"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"/>

AdWhirl 通过在清单中查找以下代码片段来获取您的 SDK 密钥:

<meta-data android:value="YOUR_SDK_KEY"
    android:name="ADWHIRL_KEY" />

更新 2:

因此根据 Millennial文档,建议您不要设置高度或宽度,而是让SDK根据设备进行优化。 HTC Desire 的屏幕密度为 1.5,因此 320x53 的广告应该放大到 480x79.5 之类的尺寸。这解释了为什么 480 是默认值。我仍然不确定为什么它太长。它应该完美契合。当你说太长时,是长了几个像素,还是长了 1.5 倍?

更新 3:

所以我实际上能够重现这个问题,这看起来像是千禧一代的一个错误。我不确定这是否只是广告素材的问题,因为我只能获得确切的广告,但该广告的宽度肯定是 480dp,而实际上它应该只有 480px 宽。如果您将设备置于横向模式,您可以看到它有多大。

我建议联系千禧一代并询问他们以前是否遇到过这个问题。

I wonder if an issue with trying to calculate width and height. Try this basic snippet instead:

LinearLayout layout = (LinearLayout) findViewById(R.id.layout_main);
AdWhirlLayout adWhirlLayout = new AdWhirlLayout(this, "apid");
layout.addView(adWhirlLayout);

UPDATE:

You can also create an AdWhirlLayout via XML.

<com.adwhirl.AdWhirlLayout
    android:id="@+id/adwhirl_layout"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"/>

AdWhirl gets your SDK key by looking in the manifest for this snippet:

<meta-data android:value="YOUR_SDK_KEY"
    android:name="ADWHIRL_KEY" />

UPDATE 2:

So according to the Millennial documentation, it is recommended that you don't set the height or width, but let the SDK optimize based on the device. The HTC Desire has a 1.5 screen density, so the 320x53 ad should get scaled up to something like 480x79.5. This explains why 480 is the default. I'm still not sure why it is too long. It should fit perfectly. When you say too long, is it too long by just a few pixels, or is it too long by a factor of 1.5?

UPDATE 3:

So I was actually able to reproduce the issue, and this looks like a bug on Millennial's end. I'm not sure if it's just the creative because I was only able to get that exact ad, but that ad is definitely 480dp wide when it should only be 480px wide. If you put your device in landscape mode you can see how big it is.

I would suggest contacting Millennial and asking them if they have seen this issue before.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文