不工作adwhril样本(adwhril sample not working)

214 IT屋

谁能给我提供一个样本集成到adwhril试图android.I这个样本

http://paste2.org/p/2168910

我用同样的code作为一个替代矿的SDK关键,但我得到警告说

在这里输入的形象描述

任何人都可以给我建议

更新code的建议,并得到了这个警告。

在这里输入的形象描述


解决方案

是啊,我也面临这个问题,以这种方式解决了

添加这些,如果你不已经在你的menifest添加

 <使用许可权的android:NAME ="android.permission.INTERNET对"/>
<使用许可权的android:NAME ="android.permission.ACCESS_NETWORK_STATE"/>

在你的活动,你要显示的添加

 <元数据的android:值="----你的关键----"
            机器人:名字="ADWHIRL_KEY"/>

现在添加您使用的是添加提供程序的所有jar,您的广告抡网络。将它们添加到您的应用程序的libs文件夹,然后将它们添加到从库上他们建立通过右键单击路径。

例如,如果你使用AdMob则AdMob的jar添加到库,并将其添加到构建路径。然后添加此行menifest因为这是需要显示来自AdMob的附加或单独使用的AdWhirl

 <活动机器人:名字="com.google.ads.AdActivity"
            android:configChanges=\"keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize\" >
        < /活性GT;

现在,您将看到的AdMob的补充道。

感谢您

PS:我已经添加了全code。与图片

Menifest

 <清单的xmlns:机器人="htt​​p://schemas.android.com/apk/res/android"
    包="com.example.expadwhirl"
    安卓版code ="1"
    机器人:=的versionName"1.0">    <用途-SDK
        安卓的minSdkVersion ="8"
        机器人:targetSdkVersion ="15"/>
    <使用许可权的android:NAME ="android.permission.INTERNET对"/>
    <使用许可权的android:NAME ="android.permission.ACCESS_NETWORK_STATE"/>
    <应用
        机器人:图标="@绘制/ ic_launcher"
        机器人:标签="@字符串/ APP_NAME"
        机器人:主题="@风格/ AppTheme">
        <活动
            机器人:名字="。MainActivity"
            机器人:标签="@字符串/ title_activity_main">
            &所述;意图滤光器>
                <作用机器人:名字="android.intent.action.MAIN"/>                <类机器人:名字="android.intent.category.LAUNCHER"/>
            &所述; /意图滤光器>
            <元数据的android:值="2f120f401e9a40d0afa55557d3a3a58c"
                机器人:名字="ADWHIRL_KEY"/>
        < /活性GT;        <活动机器人:名字="com.google.ads.AdActivity"
            android:configChanges=\"keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize\" >
        < /活性GT;
    < /用途>< /清单>

布局

 <的RelativeLayout的xmlns:机器人="htt​​p://schemas.android.com/apk/res/android"
    的xmlns:工具="htt​​p://schemas.android.com/tool​​s"
    机器人:layout_width ="match_parent"
    机器人:layout_height ="match_parent">    < com.adwhirl.AdWhirlLayout
        机器人:ID ="@ + ID / adwrl"
        机器人:layout_width ="match_parent"
        机器人:layout_height ="WRAP_CONTENT"
        机器人:layout_alignParentBottom ="真"
        机器人:layout_centerHorizo​​ntal ="真"
        />< / RelativeLayout的>

活动

 进口android.app.Activity;
进口android.os.Bundle;进口com.adwhirl.AdWhirlLayout;
进口com.adwhirl.AdWhirlLayout.AdWhirlInterface;公共类MainActivity扩展活动实现AdWhirlInterface {    AdWhirlLayout adwrl;    @覆盖
    公共无效的onCreate(捆绑savedInstanceState){
        super.onCreate(savedInstanceState);
        的setContentView(R.layout.activity_main);
    }    @覆盖
    公共无效adWhirlGeneric(){
        // TODO自动生成方法存根
    }
}

项目总体

库和引用的库

can anyone provide me a sample for integrating adwhril into android.I tried this sample

http://paste2.org/p/2168910

I used the same code as that one replacing the sdk key of mine But i am getting warnings saying

enter image description here

Can anyone suggest me

updated the code as suggested and got this warning

enter image description here

解决方案

Yea, i have also faced this problem and solved in this way

Add those if you didn't already added in your menifest

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

In your activity where you want to show the add

<meta-data android:value="---- Your Key ----"
            android:name="ADWHIRL_KEY"/>

Now add all the jar of the add provider you used, in your ad-whirl network. Add them to your app's libs folder and then add them to build path by right clicking on them from libs.

For example if you use Admob then add admob's jar to libs and add it to build path. And then add this line to menifest as this is needed to show add from admob individually or by using adwhirl

<activity android:name="com.google.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" >
        </activity>

Now you will see the adds of admob.

Thank you

Ps: i have added the full code with image

Menifest

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.expadwhirl"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <meta-data android:value="2f120f401e9a40d0afa55557d3a3a58c"
                android:name="ADWHIRL_KEY"/>
        </activity>

        <activity android:name="com.google.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" >
        </activity>
    </application>

</manifest>

Layout

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <com.adwhirl.AdWhirlLayout
        android:id="@+id/adwrl"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        />

</RelativeLayout>

Activity

import android.app.Activity;
import android.os.Bundle;

import com.adwhirl.AdWhirlLayout;
import com.adwhirl.AdWhirlLayout.AdWhirlInterface;

public class MainActivity extends Activity implements AdWhirlInterface {

    AdWhirlLayout adwrl;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    public void adWhirlGeneric() {
        // TODO Auto-generated method stub
    }
}

Overall project

Libs And Referenced Library

本文地址:IT屋 » 不工作adwhril样本

相关文章: