InMobi support in Android Adwhirl SDK 2.6.2

48 views
Skip to first unread message

tag

unread,
Feb 4, 2011, 2:31:40 PM2/4/11
to AdWhirl Users
I tried to integrate the InMobi sdk with AdWhirl.
When trying it out I got the following exception, however the
InMobiAndroidSDK jar is in build path:

D/AdWhirl SDK(16735): Showing ad:
D/AdWhirl SDK(16735): nid: 271e298c98f34f91a568bd46242a6d0c
D/AdWhirl SDK(16735): name: inmobi
D/AdWhirl SDK(16735): type: 18
D/AdWhirl SDK(16735): key: ff8080812d54a4d8012d93f473ee022a
D/AdWhirl SDK(16735): key2:
W/AdWhirl SDK(16735): Unsupported ration type: 18
W/AdWhirl SDK(16735): Caught an exception in adapter:
W/AdWhirl SDK(16735): java.lang.Exception: Invalid adapter

I have checked the jar files, and it seems to me AdWhirl tries to find
a class named InMobiAdRenderer
and no such one exists in the current InMobi SDK. I have downloaded it
today.
Is it possible to solve this somehow?
And where can i find the sources for newest adwhirl sdk?
Thanks

Damjan

unread,
Feb 5, 2011, 4:18:50 PM2/5/11
to AdWhirl Users
Same here - I guess inmobi just updated their SDK.

matt

unread,
Feb 7, 2011, 8:57:09 PM2/7/11
to AdWhirl Users
I am getting the same issue.

matt

unread,
Feb 8, 2011, 1:51:16 PM2/8/11
to AdWhirl Users
looking at the source basically it just seems like the InMobi adapter
is not included in version 2.6.2 of AdWhirl. seems weird that would
even make it an option on their site.

tag

unread,
Feb 9, 2011, 3:15:35 AM2/9/11
to AdWhirl Users
I have checked the jar file of 2.6.2 SDK, and the classes are there,
and there is value
for inmobi in AdWhirlUtil, NETWORK_TYPE_INMOBI = 18.
Some support is in 2.6.2

Damjan

unread,
Feb 9, 2011, 10:53:16 AM2/9/11
to AdWhirl Users
According to source, adwhirl doesn't implement inmobi network - yet.

There is no public static final int NETWORK_TYPE_INMOBI = 18
in http://code.google.com/p/adwhirl/source/browse/src/com/adwhirl/util/AdWhirlUtil.java?repo=sdk-android

and no InMobi adapter
in http://code.google.com/p/adwhirl/source/browse?repo=sdk-android#hg%2Fsrc%2Fcom%2Fadwhirl%2Fadapters

Damjan

tag

unread,
Feb 10, 2011, 3:14:40 AM2/10/11
to AdWhirl Users
Yes I know, it is not in the source.
But the last change in that source tree was made Nov 29, 2010, and I
can't see the tag for 2.6.2, which was released in january
The latest sdk is not from those sources, and you can check for
NETWORK_TYPE_INMOBI
with eclipse, it is there in 2.6.2.

On Feb 9, 4:53 pm, Damjan <damjan.ma...@gmail.com> wrote:
> According to source, adwhirl doesn't implement inmobi network - yet.
>
> There is no public static final int NETWORK_TYPE_INMOBI = 18
> inhttp://code.google.com/p/adwhirl/source/browse/src/com/adwhirl/util/A...
>
> and no InMobi adapter
> inhttp://code.google.com/p/adwhirl/source/browse?repo=sdk-android#hg%2F...

tiger king

unread,
Feb 10, 2011, 4:46:21 AM2/10/11
to adwhir...@googlegroups.com
I see inMobi AD showing in my test app which use adwhirl. But it is very hard to let it show up, may be network (ad network) issue.

2011/2/9 Damjan <damjan...@gmail.com>

Damjan

unread,
Feb 10, 2011, 11:20:49 AM2/10/11
to AdWhirl Users
I see. Thanks for info. I can't see 2.6.2 either.

John

unread,
Feb 11, 2011, 8:17:16 PM2/11/11
to AdWhirl Users
So in your case, you don't see the exception listed by the OP? Did you
use the latest versions of the SDKs for the inMobi and AdWhirl?

On Feb 10, 4:46 am, tiger king <tigerking1...@gmail.com> wrote:
> I see inMobi AD showing in my test app which use adwhirl. But it is very
> hard to let it show up, may be network (ad network) issue.
>
> 2011/2/9 Damjan <damjan.ma...@gmail.com>
>
>
>
>
>
>
>
> > According to source, adwhirl doesn't implement inmobi network - yet.
>
> > There is no public static final int NETWORK_TYPE_INMOBI = 18
> > in
> >http://code.google.com/p/adwhirl/source/browse/src/com/adwhirl/util/A...
>
> > and no InMobi adapter
> > in
> >http://code.google.com/p/adwhirl/source/browse?repo=sdk-android#hg%2F...

Steve B

unread,
Feb 11, 2011, 8:35:21 PM2/11/11
to AdWhirl Users
I'm getting the same Type 18 Failure - from looking at the source in
the depository it seems to be in the iPhone build, but not in the
Android Build ,though I realize according to the version history the
source only reflects up to 2.6.0 back from November, so maybe some
half-a'd version is in the 2.6.2 build...

I ended up writing my own Adapter for InMobi, but I just need to
figure out how to rebuild the Jar so I can test it. Anyone done this
before?

tiger king

unread,
Feb 12, 2011, 4:06:01 AM2/12/11
to adwhir...@googlegroups.com
Yes. No any other special configuration. I tried both Admob and Inmobi. but it is very hard to let them show up. I tried 1 hour and it shows 2 ads. I suspect that adwhirl has potential bugs. since sometime, I can see house ad returned per logcat logs, but it does not show up on screen.

2011/2/12 John <yeoho...@gmail.com>

John

unread,
Feb 12, 2011, 11:44:30 AM2/12/11
to AdWhirl Users
Which inMobi SDK did you use? According to inMobi, their v2.0 (the
only one available on their site) isn't compatible with AdWhirl SDK
(hence the exception). According to them, I need to use the older v1.2
SDK but even they are not responding back to me on where I can
download the SDK 1.2.

tiger king

unread,
Feb 12, 2011, 11:57:11 AM2/12/11
to adwhir...@googlegroups.com
Yes. Just check the InMobi sdk I am using. It is 1.2.
Attaching a copy in case you need it (only jar file)

2011/2/13 John <yeoho...@gmail.com>
InMobiAndroidSDK.jar

John

unread,
Feb 12, 2011, 12:35:42 PM2/12/11
to AdWhirl Users
Thanks for the file! I'll try it out.

On Feb 12, 11:57 am, tiger king <tigerking1...@gmail.com> wrote:
> Yes. Just check the InMobi sdk I am using. It is 1.2.
> Attaching a copy in case you need it (only jar file)
>
> 2011/2/13 John <yeohoon...@gmail.com>
>
>
>
>
>
>
>
> > Which inMobi SDK did you use? According to inMobi, their v2.0 (the
> > only one available on their site) isn't compatible with AdWhirl SDK
> > (hence the exception). According to them, I need to use the older v1.2
> > SDK but even they are not responding back to me on where I can
> > download the SDK 1.2.
>
> > On Feb 12, 4:06 am, tiger king <tigerking1...@gmail.com> wrote:
> > > Yes. No any other special configuration. I tried both Admob and Inmobi.
> > but
> > > it is very hard to let them show up. I tried 1 hour and it shows 2 ads. I
> > > suspect that adwhirl has potential bugs. since sometime, I can see house
> > ad
> > > returned per logcat logs, but it does not show up on screen.
>
>
>
>  InMobiAndroidSDK.jar
> 76KViewDownload

Steve B

unread,
Feb 12, 2011, 12:50:27 PM2/12/11
to AdWhirl Users
Thanks for the Jar - I'll have to try it out.

Here's what I got going yesterday with the Inmobi 2 SDK, but the ads
look wrong (2 different background colors & icon sits under text) when
they finally do
show up (it was giving me admob and others most of the time eventhough
I had it set to 100% inMobi with no backfill.. gotta be a server-side
issue on that..)

Dont know how to post attachments here yet, but maybe this'll be
helpful to someone out there
-------------
package com.adwhirl.adapters;

import java.util.Date;

import android.app.Activity;
import android.location.Location;
import android.text.TextUtils;
import android.util.Log;

import com.adwhirl.AdWhirlLayout;
import com.adwhirl.AdWhirlTargeting;
import com.adwhirl.AdWhirlLayout.ViewAdRunnable;
import com.adwhirl.obj.Ration;
import com.adwhirl.util.AdWhirlUtil;
import com.inmobi.androidsdk.EducationType;
import com.inmobi.androidsdk.EthnicityType;
import com.inmobi.androidsdk.GenderType;
import com.inmobi.androidsdk.InMobiAdDelegate;
import com.inmobi.androidsdk.impl.InMobiAdView;

public class InMobiAdapter extends AdWhirlAdapter implements
InMobiAdDelegate{

public InMobiAdapter(AdWhirlLayout adWhirlLayout, Ration ration) {
super(adWhirlLayout, ration);
}

@Override
public void handle() {
AdWhirlLayout adWhirlLayout = adWhirlLayoutReference.get();
if (adWhirlLayout == null) {
return;
}

try {
Activity activity = adWhirlLayout.activityReference.get();
if (activity == null) {
return;
}
InMobiAdView adView =
InMobiAdView.requestAdUnitWithDelegate((Activity)
adWhirlLayout.getContext(),this,activity,
InMobiAdDelegate.INMOBI_AD_UNIT_320X48);
adView.loadNewAd();

} catch (Exception e) {
Log.d(AdWhirlUtil.ADWHIRL, "InMobi failed to create");
e.printStackTrace();
Log.e("InMobi" , e.getMessage());
adWhirlLayout.rollover();
}
}


public void adRequestCompleted(InMobiAdView adView) {
Log.d(AdWhirlUtil.ADWHIRL, "InMobi success");

AdWhirlLayout adWhirlLayout = adWhirlLayoutReference.get();
if (adWhirlLayout == null) {
return;
}

adWhirlLayout.adWhirlManager.resetRollover();
adWhirlLayout.handler.post(new ViewAdRunnable(adWhirlLayout,
adView));
adWhirlLayout.rotateThreadedDelayed();


}

public void adRequestFailed(InMobiAdView adView) {
Log.d(AdWhirlUtil.ADWHIRL, "InMobi failure");
adView.stopReceivingNotifications();

AdWhirlLayout adWhirlLayout = adWhirlLayoutReference.get();
if (adWhirlLayout == null) {
return;
}

adWhirlLayout.rollover();

}

public int age() {
return AdWhirlTargeting.getAge();
}

public String areaCode() {
return null;
}

public Location currentLocation() {
return null;
}

public Date dateOfBirth() {
return null;
}

public EducationType education() {
return EducationType.Edu_None;
}

public EthnicityType ethnicity() {
return EthnicityType.Eth_None;
}

public GenderType gender() {
final AdWhirlTargeting.Gender gender = AdWhirlTargeting.getGender();
if (gender == AdWhirlTargeting.Gender.MALE) {
return GenderType.G_M;
} else if (gender == AdWhirlTargeting.Gender.FEMALE) {
return GenderType.G_F;
} else {
return GenderType.G_None;
}
}

public int income() {
return -1;
}

public String interests() {
return null;
}

public boolean isLocationInquiryAllowed() {
return false;
}

public boolean isPublisherProvidingLocation() {
return false;
}

public String keywords() {
final String keywords = AdWhirlTargeting.getKeywordSet() != null ?
TextUtils
.join(",", AdWhirlTargeting.getKeywordSet())
: AdWhirlTargeting.getKeywords();

return keywords;
}

public String postalCode() {
return AdWhirlTargeting.getPostalCode();
}

public String searchString() {
return null;
}

public String siteId() {
return ration.key;
}

public boolean testMode() {
return AdWhirlTargeting.getTestMode();
}



}

John

unread,
Feb 12, 2011, 6:54:37 PM2/12/11
to AdWhirl Users
Ok, so v1.2 SDK works with the current version of AdWhirl SDK. (Well,
at least it doesn't throw exception).

So far, I have yet to see any ads from inMobi though. If you look at
the Logcat for AdWhirl, every ad request is followed by either "<some
ad network> success" or "<some ad network> failure", except for inMobi
which does not report either. Also, AdWhirl always skips down to the
next network in the chain. Has anyone actually seen an ad served by
inMobi using inMobi v1.2 SDK?

Steve B

unread,
Feb 12, 2011, 7:30:01 PM2/12/11
to AdWhirl Users
I did see some inmobi ads come in with the Jar that Tiger Provided..
Plain little text ad though about half the height of a typical admob
ad so it looks a little funky.
I HAVE noticed though that even if I set to only use inmobi it'll
still squeeze in admob etc a lot of the time

EasonPai

unread,
Feb 13, 2011, 1:37:21 AM2/13/11
to AdWhirl Users
I tried v1.2 too, but there are no such method in v1.2
"InMobiAdView.initialize(this.getApplicationContext(), this, this,
InMobiAdDelegate.INMOBI_AD_UNIT_320X48);"
which is appeared in v2 sample code.

How do you handle this?

Thanks

Steve B

unread,
Feb 13, 2011, 3:04:37 PM2/13/11
to AdWhirl Users
If you're wanting to use the inmobi 1.2 with adwhirl 2.6.2 just add
the jar to your project and enable it in your adwhirl control panel.
Reply all
Reply to author
Forward
0 new messages