title: AdMob After Ad receive - IOException connecting to ad url
body: <p>i have an android app that need to show ads by AdMob.
  here's my Log:</p>
  
  <pre><code>07-18 01:55:53.116: INFO/Ads(8682): adRequestUrlHtml: &lt;html&gt;&lt;head&gt;&lt;script src="http://www.gstatic.com/afma/sdk-core-v40.js"&gt;&lt;/script&gt;&lt;script&gt;AFMA_buildAdURL({"preqs":0,"u_sd":1.5,"slotname":"**************","u_w":320,"msid":"com.paladin.hilula","cap":"m","adtest":"on","js":"afma-sdk-a-v4.1.0","isu":"*********************************","format":"320x50_mb","net":"ed","app_name":"1.android.com.paladin.hilula","hl":"hd","u_h":569,"testing":1,"u_audio":1,"u_so":"p"});&lt;/script&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;
  07-18 01:55:54.187: INFO/Ads(8682): Received ad url: &lt;"url": "http://r.admob.com:80/ad_source.php?preqs=0&amp;u_sd=1.5&amp;slotname=**************&amp;u_w=320&amp;msid=com.paladin.hilula&amp;cap=m&amp;adtest=on&amp;js=afma-sdk-a-v4.1.0&amp;isu=*************************&amp;format=320x50_mb&amp;net=ed&amp;app_name=1.android.com.paladin.hilula&amp;hl=hd&amp;u_h=569&amp;testing=1&amp;u_audio=1&amp;u_so=p&amp;output=html&amp;region=mobile_app&amp;u_tz=-180&amp;ex=1&amp;client_sdk=1", "afmaNotifyDt": "null"&gt;
  07-18 01:56:15.288: WARN/Ads(8682): IOException connecting to ad url.
  07-18 01:56:15.288: WARN/Ads(8682): java.net.SocketTimeoutException: Connection timed out
  07-18 01:56:15.288: WARN/Ads(8682):     at org.apache.harmony.luni.platform.OSNetworkSystem.connect(Native Method)
  07-18 01:56:15.288: WARN/Ads(8682):     at dalvik.system.BlockGuard$WrappedNetworkSystem.connect(BlockGuard.java:357)
  07-18 01:56:15.288: WARN/Ads(8682):     at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:204)
  07-18 01:56:15.288: WARN/Ads(8682):     at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:437)
  07-18 01:56:15.288: WARN/Ads(8682):     at java.net.Socket.connect(Socket.java:983)
  07-18 01:56:15.288: WARN/Ads(8682):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&lt;init&gt;(HttpConnection.java:75)
  07-18 01:56:15.288: WARN/Ads(8682):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&lt;init&gt;(HttpConnection.java:48)
  07-18 01:56:15.288: WARN/Ads(8682):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection$Address.connect(HttpConnection.java:322)
  07-18 01:56:15.288: WARN/Ads(8682):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:89)
  07-18 01:56:15.288: WARN/Ads(8682):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHttpConnection(HttpURLConnectionImpl.java:285)
  07-18 01:56:15.288: WARN/Ads(8682):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.makeConnection(HttpURLConnectionImpl.java:267)
  07-18 01:56:15.288: WARN/Ads(8682):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:205)
  07-18 01:56:15.288: WARN/Ads(8682):     at b.a(Unknown Source)
  07-18 01:56:15.288: WARN/Ads(8682):     at b.doInBackground(Unknown Source)
  07-18 01:56:15.288: WARN/Ads(8682):     at android.os.AsyncTask$2.call(AsyncTask.java:185)
  07-18 01:56:15.288: WARN/Ads(8682):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
  07-18 01:56:15.288: WARN/Ads(8682):     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
  07-18 01:56:15.288: WARN/Ads(8682):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
  07-18 01:56:15.288: WARN/Ads(8682):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
  07-18 01:56:15.288: WARN/Ads(8682):     at java.lang.Thread.run(Thread.java:1019)
  07-18 01:56:15.296: INFO/Ads(8682): onFailedToReceiveAd(A network error occurred.)
  </code></pre>
  
  <p>i get the URL but cant show it.</p>
  
  <p>in manifest:</p>
  
  <pre><code>    &lt;activity android:name="com.google.ads.AdActivity"
                android:configChanges="keyboard|keyboardHidden|orientation"/&gt;
    &lt;/application&gt;
    &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt;
  </code></pre>
  
  <p>in .java:</p>
  
  <pre><code>    // Create the adView
      AdView adView = new AdView(this, AdSize.BANNER, MY_AD_UNIT_ID);
      // Lookup your LinearLayout assuming it’s been given
      // the attribute android:id="@+id/mainLayout"
      RelativeLayout layout = (RelativeLayout)findViewById(R.id.rlayout);
      // Add the adView to it
      layout.addView(adView);
      // Initiate a generic request to load it with an ad
      AdRequest r = new AdRequest();
      r.setTesting(true);
      r.addTestDevice("*****************************");
  
      adView.loadAd(r);
  </code></pre>