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="a开发者_如何学Gondroid.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?
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.
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
精彩评论