1

LAYOUT xml code

main_activity.xml

<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"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin">

    <com.inmobi.monetization.IMBanner
        android:id="@+id/bannerView"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        />

</RelativeLayout>

Activity ad calling code:

    InMobi.initialize(this, "b82bc0d2c39f48c3bb1ea44e1df*****");
    IMBanner bannerAdView = (IMBanner)rooView.findViewById(R.id.bannerView);
    bannerAdView.setAppId("b82bc0d2c39f48c3bb1ea44e1df*****");
    bannerAdView.setAdSize(IMBanner.INMOBI_AD_UNIT_468X60);
    bannerAdView.setIMBannerListener(new IMBannerListener() {
        @Override
        public void onBannerRequestFailed(IMBanner imBanner, IMErrorCode imErrorCode) {
            Log.e("INMOBI","error code: "+imErrorCode.toString());
        }

        @Override
        public void onBannerRequestSucceeded(IMBanner imBanner) {

        }

        @Override
        public void onBannerInteraction(IMBanner imBanner, Map<String, String> map) {

        }

        @Override
        public void onShowBannerScreen(IMBanner imBanner) {

        }

        @Override
        public void onDismissBannerScreen(IMBanner imBanner) {

        }

        @Override
        public void onLeaveApplication(IMBanner imBanner) {

        }
    });
    bannerAdView.loadBanner();

errors: 08-05 15:40:14.689 24221-24221/? D/[InMobi]-4.5.5﹕ InMobi init successful 08-05 15:40:14.689 24221-24221/? D/[InMobi]-[AdTracker]-4.5.5﹕ IMAdtracker init successfull 08-05 15:40:14.748 24221-24221/? D/[InMobi]-[Analytics]-4.5.5﹕ NetworkManager-> Constructor 08-05 15:40:14.753 24221-24221/? D/[InMobi]-4.5.5﹕ Google play services not included. 08-05 15:40:14.764 24221-24352/? D/[InMobi]-[AdTracker]-4.5.5﹕ Goal download enqueued successfully for reporting 08-05 15:40:14.788 24221-24221/? D/[InMobi]-[Monetization]﹕ Current Ad State: loading D/[InMobi]-4.5.5﹕ Http Status Code: 204 E/INMOBI﹕ error code: The ad request was successful, but no ad was returned

Note: Testing mode is enabled for device (android) with odin1 number but i am not getting testing ad from inmobi server and app id checked.

1 Answers1

4

Can you please set the LogLevel of the SDK using the following code:

InMobiSdk.setLogLevel(InMobiSdk.LogLevel.DEBUG);

Once done, you will see the following message on the console: The message on the SDK console is "Publisher device ID is xyz"

Please enter the device-id(xyz in this case) in the Publisher dashboard while enabling Diagnostics mode. You should be able to see the test ads from InMobi.

Community
  • 1
  • 1
  • yes i am able to see the ads on other testing app but not able to see testing ads on another app which is using GCM(new gcm integration method) and i am also including google play services but inmobi debug show me message: 15:40:14.753 24221-24221/? D/[InMobi]-4.5.5﹕ Google play services not included. 08-05 – Lalit Pratap Singh Aug 11 '15 at 11:01
  • How are you adding Google play services to your app? Also, which app are you seeing ads on, the app bundled with the InMobi SDK? – Nehal Mehta Aug 12 '15 at 11:24
  • compile 'com.google.android.gms:play-services:6.5.87' i am adding google play services like i have mentioned. – Lalit Pratap Singh Aug 13 '15 at 05:39
  • Ok, can you see the test ads by entering the Publisher Device ID mentioned in the logs, under the diagnostics section in the InMobi portal? – Nehal Mehta Aug 18 '15 at 09:43
  • I can't turn on the selective test mode (it's greyed) to add device id. – Srikar Reddy Sep 24 '16 at 11:09