0

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

G_S
  • 7,068
  • 2
  • 21
  • 51
  • Please check URL http://stackoverflow.com/questions/7594563/android-integration-adwhirl-and-admob – Nikhil Sep 12 '12 at 13:09
  • Thanks for the URL. I am with the same warning list as above capture. Can you suggest me please – G_S Sep 12 '12 at 16:03

1 Answers1

2

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

Chinmoy Debnath
  • 2,814
  • 16
  • 20
  • Thanks for the sample .But i am not able to get this sample worked. android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" line is giving me an error. among those configchanges parameters screenSize|smallestScreenSize are not present and when i try to run the sample by removing them its giving an error saying "You must have AdActivity declared in AndroidManifest.xml with configChanges". Can i be suggested a little more please. And i am having all the remaining things added to my sample. . – G_S Sep 14 '12 at 11:12
  • Can you go to your project.properties file and change if not its 14 or – Chinmoy Debnath Sep 14 '12 at 15:34
  • yes i searched for the error in google and found that these configs work for 14 or more. So i changed it to 16 but even this didnt help me. I got a warning which is saying problem with adapter – G_S Sep 14 '12 at 15:42
  • I think that's not an error but a warning. i edited it in the question – G_S Sep 14 '12 at 15:46
  • I think that error shows as you add some parental advisory like age will be 23 in your code as that tutorial does. – Chinmoy Debnath Sep 14 '12 at 15:50
  • No right now i removed everything and just used your sample as an example. – G_S Sep 14 '12 at 15:51
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/16700/discussion-between-chinmoy-debnath-and-sharath-g) – Chinmoy Debnath Sep 14 '12 at 15:54
  • can you please send me this working sample ? i have facing the same warnings at logcat – Mudassar Shaheen Dec 31 '12 at 05:47