Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid AdMob embeding, network and centering problems
    primarykey
    data
    text
    <p>I am trying to add admob on my application. What I wanna see is bottom center admob banner but I couldn't do it after 5 hours and looking for help. (yes 5 fraking hours) I have 2 errors also which make admob doesn't even show up I believe..</p> <p>one error is "onFailedToReceiveAd(A network error occurred.)" and other one is "Can't get the viewWidth after the first layout"</p> <p>I tried any FILL PARRENT WRAP CONTENT and Gravity.CENTER Combination even which are I didnt write here coz of so many of them. even if It shows up still at left-bottom. I need center-bottom...</p> <p>Many thanks in advance for your help</p> <p>Here the code and logCAT;</p> <pre><code>Window window = getWindow(); RelativeLayout adsLayout = new RelativeLayout(this); RelativeLayout.LayoutParams lp2 = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT); adsLayout.setGravity(Gravity.BOTTOM); adView = new AdView(this, AdSize.BANNER, "a1xxx6c"); AdRequest adRequest = new AdRequest(); adRequest.addTestDevice(AdRequest.TEST_EMULATOR); adView.loadAd(adRequest); adsLayout.addView(adView); window.addContentView(adsLayout,lp2); I/Ads(4564): adRequestUrlHtml: &lt;html&gt;&lt;head&gt;&lt;script src="http://media.admob.com/sdk-core-v40.js"&gt;&lt;/script&gt;&lt;script&gt;AFMA_buildAdURL({"preqs":0,"u_sd":1.5,"slotname":"a1xxx6c","u_w":569,"msid":"ko.tb","simulator":1,"cap":"m,a","adtest":"on","js":"afma-sdk-a-v4.3.1","isu":"B3EEABB8EE11C2BE770B684D95219ECB","cipa":0,"format":"320x50_mb","net":"ed","app_name":"11.android.ko.tb","hl":"en","u_h":320,"u_audio":4});&lt;/script&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt; D/dalvikvm(4564): GC_EXTERNAL_ALLOC freed 80K, 49% free 2820K/5511K, external 17296K/18967K, paused 113ms I/dalvikvm-heap(4564): Clamp target GC heap from 24.915MB to 24.000MB D/dalvikvm(4564): GC_FOR_MALLOC freed 6K, 49% free 2814K/5511K, external 18046K/18967K, paused 48ms E/ERROR(4564): ERROR IN CODE: java.lang.NullPointerException W/System.err(4564):java.lang.NullPointerException W/System.err(4564):at ko.tb.KOActivity.EksikSorularWebService(KOActivity.java:1413) W/System.err(4564):at ko.tb.KOActivity.checkDB(KOActivity.java:457) W/System.err(4564):at ko.tb.KOActivity.GenelTimeline(KOActivity.java:410) W/System.err(4564):at ko.tb.KOActivity$1.onTick(KOActivity.java:307) W/System.err(4564):at android.os.CountDownTimer$1.handleMessage(CountDownTimer.java:124) W/System.err(4564):at android.os.Handler.dispatchMessage(Handler.java:99) W/System.err(4564):at android.os.Looper.loop(Looper.java:123) W/System.err(4564):at android.app.ActivityThread.main(ActivityThread.java:3683) W/System.err(4564):at java.lang.reflect.Method.invokeNative(Native Method) W/System.err(4564):at java.lang.reflect.Method.invoke(Method.java:507) W/System.err(4564):at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) W/System.err(4564):at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) W/System.err(4564):at dalvik.system.NativeStart.main(Native Method) W/webcore(4564): Can't get the viewWidth after the first layout I/Ads(4564): AdLoader timed out after 60000ms while getting the URL. D/webviewglue(4564): nativeDestroy view: 0x3903c0 I/Ads(4564): onFailedToReceiveAd(A network error occurred.) </code></pre> <p> </p> <pre><code>&lt;uses-sdk android:minSdkVersion="5" android:targetSdkVersion="14" /&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt; &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt; &lt;activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|s‌​creenSize|smallestScreenSize"/&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload