2015-10-09 9 views
8

Ho WebView + ListView e AdView sotto lo schermo. WebView o ListView funziona in modo terribile lento sui dispositivi più vecchi (4.0-4.3 Android) fino a quando non viene caricato AdView, quindi funziona molto agevolmente.AdView rallenta l'intera app, motivo possibile

Logcat mostra che AdMob tenta di caricare qualcosa incredibilmente spesso senza successo fino a .. successo e quindi l'app è liscia. Potrebbe essere una ragione? Come sistemarlo?

10-10 01:02:20.954 7160-7214/com.test.test V/webcore﹕ webkitDraw NEW_PICTURE_MSG_ID 
10-10 01:02:20.964 7160-7214/com.test.test V/webcore﹕ WEBKIT_DRAW arg1=0 arg2=0 obj=null 
10-10 01:02:20.974 7160-7214/com.test.test V/webcore﹕ webkitDraw start 
10-10 01:02:20.974 7160-7214/com.test.test V/webcore﹕ webkitDraw NEW_PICTURE_MSG_ID 
10-10 01:02:21.004 7160-7160/com.test.test V/webview﹕ NEW_PICTURE_MSG_ID 
10-10 01:02:21.004 7160-7160/com.test.test V/webview﹕ NEW_PICTURE_MSG_ID 
10-10 01:02:21.004 7160-7214/com.test.test V/webcore﹕ WEBKIT_DRAW arg1=0 arg2=0 obj=null 
10-10 01:02:21.004 7160-7214/com.test.test V/webcore﹕ webkitDraw start 
10-10 01:02:21.014 7160-7214/com.test.test V/webcore﹕ webkitDraw NEW_PICTURE_MSG_ID 
10-10 01:02:21.024 7160-7214/com.test.test V/webcore﹕ WEBKIT_DRAW arg1=0 arg2=0 obj=null 
10-10 01:02:21.024 7160-7214/com.test.test V/webcore﹕ webkitDraw start 
10-10 01:02:21.044 7160-7214/com.test.test V/webcore﹕ webkitDraw NEW_PICTURE_MSG_ID 
10-10 01:02:21.044 7160-7160/com.test.test V/webview﹕ NEW_PICTURE_MSG_ID 
10-10 01:02:21.054 7160-7214/com.test.test V/webcore﹕ WEBKIT_DRAW arg1=0 arg2=0 obj=null 
10-10 01:02:21.054 7160-7214/com.test.test V/webcore﹕ webkitDraw start 
10-10 01:02:21.054 7160-7160/com.test.test V/webview﹕ NEW_PICTURE_MSG_ID 
10-10 01:02:21.054 7160-7214/com.test.test V/webcore﹕ webkitDraw NEW_PICTURE_MSG_ID 
10-10 01:02:21.074 7160-7214/com.test.test V/webcore﹕ WEBKIT_DRAW arg1=0 arg2=0 obj=null 
10-10 01:02:21.074 7160-7214/com.test.test V/webcore﹕ webkitDraw start 
10-10 01:02:21.084 7160-7214/com.test.test V/webcore﹕ webkitDraw NEW_PICTURE_MSG_ID 
10-10 01:02:21.084 7160-7160/com.test.test V/webview﹕ NEW_PICTURE_MSG_ID 
10-10 01:02:21.094 7160-7160/com.test.test V/webview﹕ NEW_PICTURE_MSG_ID 
10-10 01:02:21.104 7160-7214/com.test.test V/webcore﹕ WEBKIT_DRAW arg1=0 arg2=0 obj=null 
10-10 01:02:21.114 7160-7214/com.test.test V/webcore﹕ webkitDraw start 
10-10 01:02:21.114 7160-7214/com.test.test V/webcore﹕ webkitDraw NEW_PICTURE_MSG_ID 
10-10 01:02:21.124 7160-7214/com.test.test V/webcore﹕ WEBKIT_DRAW arg1=0 arg2=0 obj=null 
10-10 01:02:21.134 7160-7160/com.test.test V/webview﹕ NEW_PICTURE_MSG_ID 
10-10 01:02:21.134 7160-7214/com.test.test V/webcore﹕ WEBKIT_DRAW arg1=0 arg2=0 obj=null 
10-10 01:02:21.144 7160-7214/com.test.test V/webcore﹕ webkitDraw start 
10-10 01:02:21.144 7160-7214/com.test.test V/webcore﹕ webkitDraw NEW_PICTURE_MSG_ID 
10-10 01:02:21.164 7160-7214/com.test.test V/webcore﹕ WEBKIT_DRAW arg1=0 arg2=0 obj=null 
10-10 01:02:21.164 7160-7214/com.test.test V/webcore﹕ webkitDraw start 
10-10 01:02:21.164 7160-7214/com.test.test V/webcore﹕ webkitDraw NEW_PICTURE_MSG_ID 
10-10 01:02:21.174 7160-7214/com.test.test V/webcore﹕ WEBKIT_DRAW arg1=0 arg2=0 obj=null 
10-10 01:02:21.184 7160-7160/com.test.test V/webview﹕ NEW_PICTURE_MSG_ID 
10-10 01:02:21.184 7160-7214/com.test.test V/webcore﹕ WEBKIT_DRAW arg1=0 arg2=0 obj=null 
10-10 01:02:21.184 7160-7214/com.test.test V/webcore﹕ webkitDraw start 
10-10 01:02:21.194 7160-7214/com.test.test V/webcore﹕ webkitDraw NEW_PICTURE_MSG_ID 
10-10 01:02:21.194 7160-7160/com.test.test V/webview﹕ NEW_PICTURE_MSG_ID 
10-10 01:02:21.194 7160-7214/com.test.test V/webcore﹕ WEBKIT_DRAW arg1=0 arg2=0 obj=null 
10-10 01:02:21.204 7160-7214/com.test.test V/webcore﹕ webkitDraw start 
10-10 01:02:21.224 7160-7214/com.test.test V/webcore﹕ webkitDraw NEW_PICTURE_MSG_ID 
10-10 01:02:21.234 7160-7160/com.test.test V/webview﹕ NEW_PICTURE_MSG_ID 
10-10 01:02:21.234 7160-7160/com.test.test V/webview﹕ NEW_PICTURE_MSG_ID 
10-10 01:02:22.754 7160-7163/com.test.test D/dalvikvm﹕ GC_CONCURRENT freed 380K, 12% free 7624K/8583K, paused 17ms+38ms, total 102ms 
10-10 01:02:24.514 7160-7214/com.test.test V/webcore﹕ SET_BACKGROUND_COLOR arg1=0 arg2=0 obj=null 
10-10 01:02:24.534 7160-7214/com.test.test V/webcore﹕ SET_ACTIVE arg1=0 arg2=0 obj=null 
10-10 01:02:24.554 7160-7214/com.test.test V/webcore﹕ LOAD_DATA arg1=0 arg2=0 [email protected] 
10-10 01:02:24.564 7160-7160/com.test.test V/webview﹕ WEBCORE_INITIALIZED_MSG_ID 
10-10 01:02:24.714 7160-7160/com.test.test V/webview﹕ setCertificate=null 
10-10 01:02:24.744 7160-7160/com.test.test V/webview﹕ WEBCORE_NEED_TOUCH_EVENTS 
10-10 01:02:24.894 7160-7160/com.test.test V/webview﹕ SELECTION_STRING_CHANGED 
10-10 01:02:24.904 7160-7160/com.test.test V/webview﹕ SELECTION_STRING_CHANGED 
10-10 01:02:24.904 7160-7160/com.test.test V/webview﹕ SELECTION_STRING_CHANGED 
10-10 01:02:24.904 7160-7214/com.test.test V/webcore﹕ didFirstLayout standardLoad =true 
10-10 01:02:24.904 7160-7214/com.test.test V/webcore﹕ Can't get the viewWidth yet 
10-10 01:02:24.914 7160-7160/com.test.test V/webview﹕ SAVE_WEBARCHIVE_FINISHED 
10-10 01:02:25.064 7160-7160/com.test.test I/Ads﹕ Scheduling ad refresh 60000 milliseconds from now. 
10-10 01:02:25.084 7160-7214/com.test.test V/webcore﹕ LOAD_URL arg1=0 arg2=0 [email protected] 
10-10 01:02:25.084 7160-7214/com.test.test V/webcore﹕ CORE loadUrl about:blank 
10-10 01:02:25.224 7160-7214/com.test.test V/webcore﹕ didFirstLayout standardLoad =true 
10-10 01:02:25.234 7160-7214/com.test.test V/webcore﹕ setupViewport mRestoredScale=0.0 mViewScale=1.0 mTextWrapScale=1.0 data.mScale= 1.0 
10-10 01:02:25.234 7160-7214/com.test.test V/webcore﹕ viewSizeChanged w=320; h=50; textwrapWidth=320; scale=1.0 
10-10 01:02:25.244 7160-7214/com.test.test V/webcore﹕ WEBKIT_DRAW arg1=0 arg2=0 obj=null 
10-10 01:02:25.254 7160-7214/com.test.test V/webcore﹕ webkitDraw start 
10-10 01:02:25.254 7160-7214/com.test.test V/webcore﹕ webkitDraw NEW_PICTURE_MSG_ID 
10-10 01:02:25.254 7160-7214/com.test.test V/webcore﹕ LOAD_URL arg1=0 arg2=0 [email protected] 
10-10 01:02:25.264 7160-7214/com.test.test V/webcore﹕ CORE loadUrl javascript:AFMA_updateActiveView({"units":[{"viewBox":{"bottom":480,"right":320,"left":0,"top":0},"isScreenOn":true,"isPaused":false,"adFormat":"320x50_as","localVisibleBoxVisible":false,"activeViewJSON":{"click_string":"BBggidEcYVtTJNpG6pAPDj7qgBAD1k7K5qQIAABABOAHIAQPIA4gEoAYD","active_experiment_ids":"","is_active_view_immediate_enabled":true,"activeview_cpm_urls":[]},"hashCode":"a096ae7d-5728-4f8b-9c0b-95ea0edc1618","afmaVersion":"afma-sdk-a-v8115000.8115000.0","windowVisibility":0,"screenDensity":1,"localVisibleBox":{"bottom":0,"right":0,"left":0,"top":0},"isAttachedToWindow":true,"timestamp":13403686,"globalVisibleBox":{"bottom":0,"right":0,"left":0,"top":0},"isVisible":true,"adBox":{"bottom":430,"right":0,"left":0,"top":430},"hitBox":{"bottom":0,"right":0,"left":0,"top":0},"isMraid":false,"globalVisibleBoxVisible":false,"isStopped":false}]}); 
10-10 01:02:25.364 7160-7160/com.test.test I/Ads﹕ Ad finished loading. 
10-10 01:02:25.594 7160-7160/com.test.test V/webview﹕ setCertificate=null 
10-10 01:02:25.594 7160-7160/com.test.test V/webview﹕ WEBCORE_NEED_TOUCH_EVENTS 
10-10 01:02:25.594 7160-7160/com.test.test V/webview﹕ SELECTION_STRING_CHANGED 
10-10 01:02:25.594 7160-7160/com.test.test V/webview﹕ SELECTION_STRING_CHANGED 
10-10 01:02:25.594 7160-7160/com.test.test V/webview﹕ SELECTION_STRING_CHANGED 
10-10 01:02:25.604 7160-7160/com.test.test V/webview﹕ SAVE_WEBARCHIVE_FINISHED 
10-10 01:02:25.604 7160-7160/com.test.test V/webview﹕ NEW_PICTURE_MSG_ID 
10-10 01:02:25.644 7160-7160/com.test.test V/webview﹕ sendOurVisibleRect=(0,430,r=320,b=480 
10-10 01:02:25.664 7160-7163/com.test.test D/dalvikvm﹕ GC_CONCURRENT freed 324K, 11% free 7716K/8583K, paused 24ms+32ms, total 130ms 
10-10 01:02:26.434 7160-7214/com.test.test V/webcore﹕ LOAD_URL arg1=0 arg2=0 [email protected] 
10-10 01:02:26.434 7160-7214/com.test.test V/webcore﹕ CORE loadUrl javascript:AFMA_updateActiveView({"units":[{"viewBox":{"bottom":480,"right":320,"left":0,"top":0},"isScreenOn":true,"isPaused":false,"adFormat":"320x50_as","localVisibleBoxVisible":false,"activeViewJSON":{"click_string":"BBggidEcYVtTJNpG6pAPDj7qgBAD1k7K5qQIAABABOAHIAQPIA4gEoAYD","active_experiment_ids":"","is_active_view_immediate_enabled":true,"activeview_cpm_urls":[]},"hashCode":"a096ae7d-5728-4f8b-9c0b-95ea0edc1618","afmaVersion":"afma-sdk-a-v8115000.8115000.0","windowVisibility":0,"screenDensity":1,"localVisibleBox":{"bottom":0,"right":0,"left":0,"top":0},"isAttachedToWindow":true,"timestamp":13403836,"globalVisibleBox":{"bottom":0,"right":0,"left":0,"top":0},"isVisible":true,"adBox":{"bottom":430,"right":0,"left":0,"top":430},"hitBox":{"bottom":0,"right":0,"left":0,"top":0},"isMraid":false,"globalVisibleBoxVisible":false,"isStopped":false}]}); 
10-10 01:02:26.474 7160-7214/com.test.test V/webcore﹕ LOAD_URL arg1=0 arg2=0 [email protected] 
10-10 01:02:26.474 7160-7214/com.test.test V/webcore﹕ CORE loadUrl javascript:AFMA_updateActiveView({"units":[{"viewBox":{"bottom":480,"right":320,"left":0,"top":0},"isScreenOn":true,"isPaused":false,"adFormat":"320x50_as","localVisibleBoxVisible":true,"activeViewJSON":{"click_string":"BBggidEcYVtTJNpG6pAPDj7qgBAD1k7K5qQIAABABOAHIAQPIA4gEoAYD","active_experiment_ids":"","is_active_view_immediate_enabled":true,"activeview_cpm_urls":[]},"hashCode":"a096ae7d-5728-4f8b-9c0b-95ea0edc1618","afmaVersion":"afma-sdk-a-v8115000.8115000.0","windowVisibility":0,"screenDensity":1,"localVisibleBox":{"bottom":50,"right":320,"left":0,"top":0},"isAttachedToWindow":true,"timestamp":13404006,"globalVisibleBox":{"bottom":480,"right":320,"left":0,"top":430},"isVisible":true,"adBox":{"bottom":480,"right":320,"left":0,"top":430},"hitBox":{"bottom":50,"right":320,"left":0,"top":0},"isMraid":false,"globalVisibleBoxVisible":true,"isStopped":false}]}); 
10-10 01:02:26.484 7160-7214/com.test.test V/webcore﹕ SET_SCROLL_OFFSET arg1=1 arg2=0 obj=Point(0, 0) 
10-10 01:02:26.514 7160-7214/com.test.test V/webcore﹕ SET_GLOBAL_BOUNDS arg1=0 arg2=0 obj=Rect(0, 430 - 320, 480) 
10-10 01:02:26.524 7160-7214/com.test.test V/webcore﹕ VIEW_SIZE_CHANGED arg1=0 arg2=0 [email protected] 
10-10 01:02:26.524 7160-7214/com.test.test V/webcore﹕ viewSizeChanged w=320; h=50; textwrapWidth=320; scale=1.0 

EDIT:

AdView viene creato nel metodo Activity.onCreate. VISIBILE all'inizio. http://pastebin.com/xZ7C8WGK

+0

Codice su come si aggiunge adview e quando esattamente lo si aggiunge sarebbe bello –

+0

Fatto. Dai un'occhiata se hai un po 'di tempo. – ElSajko

+0

L'ho visto e tutto sembra a posto. Come vedo dal tuo file di registro, la visualizzazione web sta "facendo" qualcosa. Forse il problema deriva dal layout. Hai l'accelerazione hardware? La visualizzazione delle app richiede il ridisegno del web/listview. C'è animazione per la visualizzazione e c'è qualche ragione per cui questa animazione può causare il calcolo del layout su ciascun frame? –

risposta

2

Molto probabilmente è un problema. Può essere facilmente controllato rimuovendo AdView (se ho capito bene) Non conosco le specifiche della tua applicazione, ma ti consiglio di provare Crosswalk Project.

In generale, lavorare con Admob per essere sincrono, ma è possibile provare a utilizzare AsyncTask per la sua creazione. In alternativa, puoi provare a pubblicare annunci immediatamente, ma dopo un po 'di tempo.

Ancora posso consigliare di provare a utilizzare un third-party plug-in per Admob.

Infine, il caso potrebbe trovarsi in un canale Internet instabile. Questo è tutto quello che riuscivo a pensare. Spero che tutto andrà bene.

+0

Non è possibile utilizzare il Progetto Crosswalk perché non consentono di creare un'istanza della vista con Contesto di servizio (oltre a aggiungere 20mb extra all'apk) AsyncTask per creazione di oggetti AdView o ASyncTask per caricare annunci in adview? Daremo un'occhiata al plug-in di terze parti, non sapendo che esiste un'alternativa per AdMob, ma che comunque è connessa ad AdMob. Il canale Internet instabile non è un caso, perché molti utenti lo sperimentano. – ElSajko

+0

Prova a utilizzare un'attività per tutti. È solo un'idea Quindi mi raccomando di vedere i plug-in di terze parti. In bocca al lupo. Mi dispiace non posso aiutare. – user2413972

2

Ho un'animazione semplice che viene eseguita all'avvio dell'app, che funzionava senza intoppi prima di inserire annunci AdMob, a quanto pare AdMob ha bisogno di molte risorse da avviare.

quindi la mia soluzione era aspettare che le animazioni finissero, quindi iniziare a caricare l'annuncio.

Admob è solo lento all'avvio, quindi questo ha risolto il ritardo di avvio.

Problemi correlati