如何在 Android 中将 Inmobi 与 Adwhirl 和 Admob 集成
我已经在我的 Android 应用程序中使用了带有 ad-whirl 的 admob 4.3.1...但我也想使用 Inmobi...但我不知道是否必须更改代码中的某些内容...我读到了 inmobi reqiure Adwhirl 3.0.0 sdk...但我正在使用 3.1.1 和 admob... 请提供任何帮助...
我放置了 3 个 SDK...使用了所需的权限,, 声明这两项活动:
<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation"/>
<!-- Mandatory activity declaration to show the Ad in the embedded browser -->
<activity android:name="com.inmobi.androidsdk.IMBrowserActivity"
android:configChanges="keyboardHidden|orientation|keyboard" />
在我的活动中:
LinearLayout adLayout = (LinearLayout) findViewById(R.id.ads);
AdWhirlLayout adWhirlLayout = new AdWhirlLayout(this, "Key");
RelativeLayout.LayoutParams adWhirlLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT);
adLayout.addView(adWhirlLayout, adWhirlLayoutParams);
I already used admob 4.3.1 with ad-whirl in my android application...but i want to use Inmobi too...but I don't know if i must change something in my code...i read that inmobi reqiure Adwhirl 3.0.0 sdk...but i'm using 3.1.1 with admob...
any help please...
i put the 3 SDKs...used the needed Permissions,,
Declaring these two activites:
<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation"/>
<!-- Mandatory activity declaration to show the Ad in the embedded browser -->
<activity android:name="com.inmobi.androidsdk.IMBrowserActivity"
android:configChanges="keyboardHidden|orientation|keyboard" />
and this in my activity:
LinearLayout adLayout = (LinearLayout) findViewById(R.id.ads);
AdWhirlLayout adWhirlLayout = new AdWhirlLayout(this, "Key");
RelativeLayout.LayoutParams adWhirlLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT);
adLayout.addView(adWhirlLayout, adWhirlLayoutParams);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您查看 AdWhirl 更改日志< /a>,可以看到AdWhirl 3.1.1已经支持最新的InMobi SDK,目前是v300。如果您有 AdWhirl 3.1.1,请确保您使用的是最新的 InMobi SDK。
另一方面,如果您使用的是 AdMob 4.3.1,则需要将活动声明更新为:
如果您在使用上述代码时遇到问题,请查看 此博文,了解有关如何迁移到的更多信息AdMob SDK v4.3.1。如果您将 AdMob 与 AdWhirl 结合使用,此信息同样重要。
假设您使用正确的应用程序密钥,则定义布局的 Java 代码是正确的。除了最新的 SDK 之外,不需要任何其他东西即可让 InMobi 正常工作。
If you look at the AdWhirl change log, you can see that AdWhirl 3.1.1 has support for the latest InMobi SDK, which is currently v300. If you have AdWhirl 3.1.1, make sure you're using the latest InMobi SDK.
On another note, if you are using AdMob 4.3.1, you'll need to update your activity declaration to:
If you are having issues with the above code, please check out this blog post for more information on how to migrate to v4.3.1 of the AdMob SDK. This information is just as relevant if you are using AdMob with AdWhirl.
Your Java code which defines your layout is correct, assuming you are using the right app key. Nothing else should be needed to get InMobi working other than their latest SDK.