开发者

Why is AdWhirl showing no adds in my android App?

I just integrated adwhirl into my android app. Now I'm a little bit puzzled on how to ensure that ads are shown in my App.

I activated admob as the only ad serving network for now. After my app starts I get the following log output:

06-10 14:03:08.007: INFO/AdWhirl SDK(4881): Creating adWhirlManager...
06-10 14:03:08.014: DEBUG/AdWhirl SDK(4881): Locale is: de_DE
06-10 14:03:08.014: DEBUG/AdWhirl SDK(4881): Hashed device ID is: ...
06-10 14:03:08.022: INFO/AdWhirl SDK(4881): Finished creating adWhirlManager
06-10 14:03:08.389: DEBUG/AdWhirl SDK(488开发者_JAVA百科1): Prefs{...}: {"config": "{"extra":{"location_on":0,"background_color_rgb":{"red":40,"green":53,"blue":98,"alpha":1},"text_color_rgb":{"red":255,"green":255,"blue":255,"alpha":1},"cycle_time":30,"transition":3},"rations":[{"nid":"706a61fa3ec446c7b016bfa9d39256d4","type":1,"nname":"admob","weight":100,"priority":1,"key":"a14deaa0ed3f8f6"}]}
06-10 14:03:08.389: DEBUG/AdWhirl SDK(4881): ", "timestamp": 1307707109720}
06-10 14:03:08.389: INFO/AdWhirl SDK(4881): Using stored config data
06-10 14:03:08.389: DEBUG/AdWhirl SDK(4881): Received jsonString: {"extra":{"location_on":0,"background_color_rgb":{"red":40,"green":53,"blue":98,"alpha":1},"text_color_rgb":{"red":255,"green":255,"blue":255,"alpha":1},"cycle_time":30,"transition":3},"rations":[{"nid":"706a61fa3ec446c7b016bfa9d39256d4","type":1,"nname":"admob","weight":100,"priority":1,"key":"a14deaa0ed3f8f6"}]}
06-10 14:03:08.600: INFO/AdWhirl SDK(4881): Rotating Ad
06-10 14:03:08.600: DEBUG/AdWhirl SDK(4881): Dart is <91.2614682720399> of <100.0>
06-10 14:03:08.921: DEBUG/AdWhirl SDK(4881): Showing ad:
06-10 14:03:08.921: DEBUG/AdWhirl SDK(4881):     nid: 706a61fa3ec446c7b016bfa9d39256d4
06-10 14:03:08.921: DEBUG/AdWhirl SDK(4881):     name: admob
06-10 14:03:08.921: DEBUG/AdWhirl SDK(4881):     type: 1
06-10 14:03:08.921: DEBUG/AdWhirl SDK(4881):     key: a14deaa0ed3f8f6
06-10 14:03:08.921: DEBUG/AdWhirl SDK(4881):     key2: 
06-10 14:03:08.936: DEBUG/AdWhirl SDK(4881): Valid adapter, calling handle()

Update I also found this in the logs

06-10 14:45:34.546: ERROR/Ads(6010): ACCESS_NETWORK_STATE permissions must be enabled in AndroidManifest.xml.
06-10 14:45:34.546: ERROR/Ads(6010): You must have INTERNET and ACCESS_NETWORK_STATE permissions in AndroidManifest.xml.
06-10 14:45:34.764: ERROR/Ads(6010): ACCESS_NETWORK_STATE permissions must be enabled in AndroidManifest.xml.

/Update

I use this code to integrate AdWhirl into my app:

    AdWhirlManager.setConfigExpireTimeout(1000 * 60 * 5);

    AdWhirlTargeting.setAge(28);
    AdWhirlTargeting.setGender(AdWhirlTargeting.Gender.MALE);
    AdWhirlTargeting.setKeywords("banking, credit, interest");
    AdWhirlTargeting.setPostalCode("93047");
    AdWhirlTargeting.setTestMode(true);

    adWhirlLayout = new AdWhirlLayout(this, "my Key");

    RelativeLayout.LayoutParams adWhirlLayoutParams = new RelativeLayout.LayoutParams(
            LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);

    LinearLayout layout = (LinearLayout) findViewById(R.id.layout_adwhirl);

    layout.addView(adWhirlLayout, adWhirlLayoutParams);
    layout.invalidate();

This is the layout for the screen that should show the ads:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   android:background="#283562">

   <LinearLayout
       android:id="@+id/layout_adwhirl"
       android:orientation="vertical"
       android:layout_width="fill_parent"
       android:layout_height="wrap_content"
       android:layout_alignParentBottom="true"
       android:layout_centerHorizontal="true"
       android:background="@android:color/black"/>

   <ScrollView
       android:layout_width="fill_parent"
       android:layout_height="wrap_content"
       android:layout_alignParentTop="true"
       android:layout_above="@id/layout_adwhirl">

      contains the rest of the layout...

  </ScrollView>
</RelativeLayout>

The adWhirlLayout however stays empty. How can I test if this is because no ads are served to me or because I did something wrong with integrating adWhirl?


Ok this line from the log showed the problem:

06-10 14:45:34.764: ERROR/Ads(6010): ACCESS_NETWORK_STATE permissions must be enabled in AndroidManifest.xml.

The access network state permission is not optional for admob. If you want to use Admob you have to ask for this permission in your manifest file.

Add

<uses-permission
    android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>

to the manifest tag in your apps manifest.xml file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜