2012-09-28 9 views
12

Prima di tutto, grazie per aver letto questo post e in anticipo per avermi aiutato in questa materia. Attualmente sto creando un webshell per Android per eseguire Webapps, questo è in esecuzione su Android 2.2 SDK.Android 2.2 Webview causa OpenGL ES API senza contesto corrente (registrato una volta per thread)

Il problema si presenta quando il debug la mia domanda (questo viene fatto su un Android 4.0 Phone tramite usb):

09-28 11:32:32.415: D/dalvikvm(25629): Debugger has detached; object registry had 576 entries 
09-28 11:32:36.355: W/ActivityThread(25764): Application com.android_api8_webshell is waiting for the debugger on port 8100... 
09-28 11:32:36.375: I/System.out(25764): Sending WAIT chunk 
09-28 11:32:36.380: I/dalvikvm(25764): Debugger is active 
09-28 11:32:36.575: I/System.out(25764): Debugger has connected 
09-28 11:32:36.575: I/System.out(25764): waiting for debugger to settle... 
09-28 11:32:36.775: I/System.out(25764): waiting for debugger to settle... 
09-28 11:32:36.975: I/System.out(25764): waiting for debugger to settle... 
09-28 11:32:37.175: I/System.out(25764): waiting for debugger to settle... 
09-28 11:32:37.375: I/System.out(25764): waiting for debugger to settle... 
09-28 11:32:37.575: I/System.out(25764): waiting for debugger to settle... 
09-28 11:32:37.780: I/System.out(25764): waiting for debugger to settle... 
09-28 11:32:37.980: I/System.out(25764): waiting for debugger to settle... 
09-28 11:32:38.180: I/System.out(25764): waiting for debugger to settle... 
09-28 11:32:38.385: I/System.out(25764): waiting for debugger to settle... 
09-28 11:32:38.585: I/System.out(25764): debugger has settled (1497) 
09-28 11:32:38.710: I/webclipboard(25764): clipservice: [email protected] 
09-28 11:32:38.765: V/StringUrl(25764): String: http://www.cidesign.nl 
09-28 11:32:38.785: D/WML_SISO(25764): InitPasteboardJni 
09-28 11:32:38.795: V/(25764): NotificationPresenterImpl::setSettingsValue 0 
09-28 11:32:38.795: V/(25764): NotificationPresenterImpl::setSettingsValue 0 
09-28 11:32:38.800: D/webkit(25764): Firewall not null 
09-28 11:32:38.800: D/webkit(25764): euler: isUrlBlocked = false 
09-28 11:32:38.930: D/CLIPBOARD(25764): Hide Clipboard dialog at Starting input: finished by someone else... ! 
09-28 11:32:42.440: I/GATE(25764): <GATE-M>DEV_ACTION_COMPLETED</GATE-M> 
09-28 11:32:42.455: E/libEGL(25764): call to OpenGL ES API with no current context (logged once per thread) 
09-28 11:32:42.455: D/ShaderProgram(25764): couldn't load the vertex shader! 
09-28 11:32:42.455: E/libEGL(25764): call to OpenGL ES API with no current context (logged once per thread) 
09-28 11:32:42.455: D/ShaderProgram(25764): couldn't load the vertex shader! 
09-28 11:32:42.455: E/libEGL(25764): call to OpenGL ES API with no current context (logged once per thread) 
09-28 11:32:42.455: D/ShaderProgram(25764): couldn't load the vertex shader! 
09-28 11:32:42.455: E/libEGL(25764): call to OpenGL ES API with no current context (logged once per thread) 
09-28 11:32:42.455: D/ShaderProgram(25764): couldn't load the vertex shader! 
09-28 11:32:42.455: E/libEGL(25764): call to OpenGL ES API with no current context (logged once per thread) 
09-28 11:32:42.455: D/ShaderProgram(25764): couldn't load the vertex shader! 

Questo è il mio codice della mia classe principale:

package com.android_api8_webshell; 

import android.os.Bundle; 
import android.app.Activity; 
import android.util.Log; 
import android.view.Menu; 
import android.webkit.WebView; 
import android.webkit.WebSettings; 

public class Main extends Activity { 

    @Override 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.main); 

     WebView myWebView = (WebView) findViewById(R.id.webView1); 

     WebSettings webSettings = myWebView.getSettings(); 
     webSettings.setJavaScriptEnabled(true); 

     Log.v("StringUrl", "String: " + getResources().getText(R.string.url)); 

     myWebView.loadUrl(getResources().getText(R.string.url).toString()); 
    } 

    @Override 
    public boolean onCreateOptionsMenu(Menu menu) { 
     getMenuInflater().inflate(R.menu.main, menu); 
     return true; 
    } 
} 

E per ultimo ma non meno importante, è l'im xml in esecuzione con:

<resources> 
    <string name="title_activity_main">Main</string> 
    <string name="url">http://www.cidesign.nl</string> 
    <string name="app_name">Android_API8_WebShell</string> 
    <string name="menu_settings">Settings</string> 
</resources> 

Sono a conoscenza di questa configurazione che ha aiutato altri rs:

<application android:hardwareAccelerated="true" ...> 

Questo è comunque per lo SDK di sopra 2.3.3, l'SDK sto correndo con il supporto doesnt questa funzione.

Spero davvero che tu possa aiutarmi in questa faccenda.

Grazie in anticipo,

David

+0

Se esiste un modo per utilizzare un SDK più recente, è sempre possibile provare setLayerType (View.LAYER_TYPE_SOFTWARE, null); –

+0

È possibile passare al livello software utilizzando i riflessi in modo che funzionino ancora su dispositivi meno recenti. Ho descritto come: http://stackoverflow.com/questions/7781655/android-setlayertype-webview/11145961#11145961 –

+0

È obbligatorio utilizzare SDK 2.2 o si può utilizzare un SDK più recente (diciamo 4.2. 2) ma supportando 2,2 dispositivi tramite l'API di supporto? – rockeye

risposta

2

Per ottenere android:hardwareAccelerated proprietà e ancora sostenere API 8 (2.2), impostare targetSdkVersion-11 ma lasciare minSdkVersion così com'è:

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="11" /> 
<application android:hardwareAccelerated="true" ... 

Quando run su dispositivi pre-API 11, hardwareAccelerated verrà semplicemente ignorato.

+0

sto correndo dal 2.2 al 4.2 quindi qualsiasi soluzione? – PankajAndroid

+0

Questo qui. Non funziona per te? Basta impostare targetSdkVersion su 17 - questo è quello per 4.2 –

+0

scusa sta funzionando – PankajAndroid