2011-01-07 44 views
1

我想在我的应用程序添加addwhirl但我犯规显示任何广告,我做以下的事情Android的AdMob和AdWhirl中集成

的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) 
    { 
    } 

我在哪里做错了?

+0

你是否在adwhirl中添加了SDK key – nicky 2011-02-18 07:18:30

+0

我已经通过这种方式解决了它的一个老问题 – ingsaurabh 2011-02-18 07:23:08

回答

1

上述代码没有任何问题。

问题是,我不会与广告商设置的非常傻瓜错过这样的事情

2

记住,你只有真正需要INTERNET权限配置的AdWhirl页面。其余是可选的。除非您的应用程序需要,否则您不应该要求GPS位置。如果你只是为了广告而做,你会得到用户的负面反应。并且相信我,添加更多地理位置定位不会增加您的收入。