0

Below is my code snippet... There is no error, but the ad is not showing on the activity... I do not know what I am missing.. PLease HELP!

 public class InMobiAdActivity extends Activity {


@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState); 

        setContentView(R.layout.main);

        IMAdView imAdView = new IMAdView(this, IMAdView.INMOBI_AD_UNIT_320X50,"4028cba631d63df10131e1d3818b00cc (code taken from inmobi wiki as sample code for testing ads");
        LinearLayout layout = (LinearLayout)findViewById(R.id.ll);
        layout.addView(imAdView);
        IMAdRequest adRequest = new IMAdRequest();
        adRequest.setTestMode(true);
        imAdView.setIMAdRequest(adRequest);;
        imAdView.loadNewAd();

    }

}

On my Logcat it shows;

10-08 14:23:02.534: D/InMobiAndroidSDK_3.6.0(2388): requestactivity=AdRequest&u-rt=0&d-device-screen-density=1.5&d-device-screen-size=480X800&mk-siteid=4028cba631d63df10131e1d3818b00cc&u-id-map=fGtq8K%2F5btMGW7t0WElg0rMcqUSCfbWD8E%2FCvECMDB9eWL5VBtsR3k9awVDmgjD4BS024QxddQlU%0AmAdObyz5KA%3D%3D%0A&u-id-key=-1447871561&u-key-ver=1&aid=b281bb6c-ddd8-4ffe-bb5d-395be16b6607&mk-version=pr-SAND-DTGTA-20120915&mk-rel-version=pr-SAND-DTGTA-20120915&format=xhtml&mk-ads=1&h-user-agent=Mozilla%2F5.0+%28Linux%3B+U%3B+Android+2.3.3%3B+en-us%3B+sdk+Build%2FGRI34%29+AppleWebKit%2F533.1+%28KHTML%2C+like+Gecko%29+Version%2F4.0+Mobile+Safari%2F533.1&u-appBId=com.dtan.inmobi&u-appDNM=InMobiAndroidSDKSampleApp&u-appVer=1.0&d-localization=en_us&d-netType=umts&d-orientation=1&mk-ad-slot=15
10-08 14:23:02.684: I/ActivityManager(61): Displayed com.dtan.inmobi/.InMobiAdActivity: +1s472ms

EDIT: Here is my Manifest. All the permissions are indicated here as well;

 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dtan.inmobi"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
    android:minSdkVersion="10"
    android:targetSdkVersion="15" />
 <uses-permission android:name="android.permission.INTERNET"/>
 <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".InMobiAdActivity"
        android:label="title_activity_main" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name="com.inmobi.androidsdk.IMBrowserActivity" android:configChanges="keyboardHidden|orientation|keyboard" />
</application>

</manifest>
Sohan
  • 1,287
  • 1
  • 15
  • 29
omi0301
  • 473
  • 2
  • 5
  • 15
  • are u sure your device (or) emulator is connected to internet and give internet permission on your project manifest file? – Dinesh Oct 08 '12 at 06:30
  • check your emulator is connected to internet go to web browser load any url! – Dinesh Oct 08 '12 at 06:55
  • @Dinesh - I could not make the browser access the net. How can i do that? And if I got connected by that, would that fix my problem? – omi0301 Oct 08 '12 at 07:03

1 Answers1

0

Try below Post For Fixing Connect Internet To Emulator

Android Emulator is not connecting to internet

android emulator browser not connecting to internet

Find More Help From Google Here

if u find same problem try to check it real device with internet connectivity!

Community
  • 1
  • 1
Dinesh
  • 6,500
  • 10
  • 42
  • 77
  • One more question. on my app it shows on log cat 10-08 15:39:01.806: V/InmobiAndroidSDK2.3(313): Your request cannot be processed at this time.Please try again later.. Could this be because my emulator cannot connect to the internet? – omi0301 Oct 08 '12 at 07:39
  • i don't know! may be is internet problem.better way to try real device with internet connectivity! – Dinesh Oct 08 '12 at 07:44
  • I tried it on my device and accessed the wifi.. it worked.. thanks – omi0301 Oct 08 '12 at 08:06