1

我正在尝试在我的应用程序中添加 addwhirl 但我没有显示任何广告,我正在做以下事情

清单.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" />

布局.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)
    {
    }

我在哪里做错了?

4

2 回答 2

2

请记住,您只需要 INTERNET 权限。其余的都是可选的。除非您的应用需要,否则您不应要求提供 GPS 位置。如果你只是为了广告而这样做,你会得到用户的负面反应。相信我,添加更多地理定位不会增加您的收入。

于 2011-06-02T19:39:11.977 回答
1

上面的代码没有任何问题。

问题是我没有使用广告提供商设置配置 adwhirl 页面,错过这样的事情是非常愚蠢的

于 2011-02-18T09:57:39.390 回答