Android admob 和 Adwhirl 集成
我正在尝试在我的应用程序中添加 addwhirl 但我没有显示任何广告,我正在执行以下
Manifest.xml
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Layout.xml
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:myapp="http://schemas.android.com/apk/res/com.liverpool.activities"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/layout_ad" />
代码中的
try
{
AdManager.setTestDevices(new String[] { AdManager.TEST_EMULATOR });
LinearLayout layout = (LinearLayout) findViewById(R.id.layout_ad);
AdWhirlLayout adWhirlLayout = new AdWhirlLayout(this, "SDK key from adwhirl");
Display d = this.getWindowManager().getDefaultDisplay();
RelativeLayout.LayoutParams adWhirlLayoutParams = new RelativeLayout.LayoutParams(d.getWidth(), 72);
layout.addView(adWhirlLayout, adWhirlLayoutParams);
}
catch (Exception e)
{
}
我正在执行的操作,以下是我做错的地方?
I am trying to add addwhirl in my app but I doesnt show up any ads, I am doing following things
Manifest.xml
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Layout.xml
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:myapp="http://schemas.android.com/apk/res/com.liverpool.activities"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/layout_ad" />
in code I am doing following
try
{
AdManager.setTestDevices(new String[] { AdManager.TEST_EMULATOR });
LinearLayout layout = (LinearLayout) findViewById(R.id.layout_ad);
AdWhirlLayout adWhirlLayout = new AdWhirlLayout(this, "SDK key from adwhirl");
Display d = this.getWindowManager().getDefaultDisplay();
RelativeLayout.LayoutParams adWhirlLayoutParams = new RelativeLayout.LayoutParams(d.getWidth(), 72);
layout.addView(adWhirlLayout, adWhirlLayoutParams);
}
catch (Exception e)
{
}
where I am doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请记住,您实际上只需要互联网权限。其余的都是可选的。除非您的应用需要 GPS 位置,否则您不应请求 GPS 位置。如果您只是为了广告而这样做,您会得到用户的负面反应。相信我,添加更多地理定位不会增加您的收入。
Remember you only really need the INTERNET permission. The rest is optional. You shouldn't ask for GPS location unless your app needs it. If you do it just for the ads you'll get negative reactions from your users. And trust me adding more geo targeting will not increase your revenue.
上面的代码没有任何问题。
问题是我没有使用广告提供商设置配置 adwhirl 页面,错过这样的事情是非常愚蠢的
There is nothing wrong with the above code.
Problem is that I haven't configured the adwhirl page with ads provider settings its very fool to miss such thing