0

Tento executar a aplicação abaixo sem sucesso. O erro retornado informa que o site não responde, o que pode ser?

MainActivity.java e logcat. Agradeço antecipadamente pela sua atenção.

package com.mycompany.TesteWebView;

import android.app.*;
import android.os.*;
import android.webkit.*;

public class MainActivity extends Activity 
{   
@Override
   protected void onCreate(Bundle         savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

WebView myWebView = (WebView)      findViewById(R.id.webview);
  WebSettings webSettings =      myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setDomStorageEnabled(true);
 myWebView.loadUrl("http://www.google.com.uk");
             }
    }

log:

Late-enabling -Xcheck:jni
04-02 21:13:16.682 23877 23877 W        System                                       ClassLoader      referenced unknown path:      /data/app/com.mycompany.TesteWebView-2/lib/arm
 04-02 21:13:25.541 23877 23877 I   WebViewFactory                               Loading com.google.android.webview version 56.0.2924.87 (code 292408700)
 04-02 21:13:25.696 23877 23877 I   art                                          Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.TokenBindingManagerAdapter>
 04-02 21:13:25.697 23877 23877 I   art                                          Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.TokenBindingManagerAdapter>
04-02 21:13:25.704 23877 23877 I   art                                          Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.ServiceWorkerControllerAdapter>
04-02 21:13:25.705 23877 23877 I   art                                          Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.ServiceWorkerControllerAdapter>
04-02 21:13:25.718 23877 23877 I   cr_LibraryLoader                             Time to load native libraries: 2 ms (timestamps 2997-2999)
04-02 21:13:25.718 23877 23877 I   cr_LibraryLoader                             Expected native library version number "56.0.2924.87", actual native library version number "56.0.2924.87"
 04-02 21:13:25.760 23877 23877 I   cr_LibraryLoader                             Expected native library version number "56.0.2924.87", actual native library version number "56.0.2924.87"
 04-02 21:13:25.763 23877 23877 I   chromium                                     [INFO:library_loader_hooks.cc(163)] Chromium logging enabled: level = 0, default verbosity = 0
04-02 21:13:25.779 23877 23877 I   cr_BrowserStartup                            Initializing chromium process, singleProcess=true
04-02 21:13:25.814 23877 23877 I   Adreno-EGL                                   <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 10/09/15, 6cbbf7d, I3193f6e94a
 04-02 21:13:26.183 23877 23877 I   cr_Ime                                       ImeThread is enabled.
04-02 21:13:26.202 23877 24117 W   cr_media                                     Requires BLUETOOTH permission
04-02 21:13:26.255 23877 24122 D   OpenGLRenderer                               Use EGL_SWAP_BEHAVIOR_PRESERVED: true
 04-02 21:13:26.367 23877 24122 I   OpenGLRenderer                               Initialized EGL, version 1.4
 04-02 21:13:26.750 23877 24142 E   libEGL                                       validate_display:255 error 3008 (EGL_BAD_DISPLAY)
 04-02 21:13:26.875 23877 24142 W   VideoCapabilities                            Unrecognized profile 2130706433 for video/avc
 04-02 21:13:26.902 23877 24142 W   VideoCapabilities                            Unrecognized profile/level 0/3 for video/mpeg2
 04-02 21:13:26.952 23877 24142 I   VideoCapabilities                            Unsupported profile 4 for video/mp4v-es
04-02 21:13:27.023 23877 23877 W   cr_BindingManager                            Cannot call determinedVisibility() - never saw a connection for the pid: 23877
04-02 21:13:27.036 23877 23877 W   cr_BindingManager                            Cannot call determinedVisibility() - never saw a connection for the pid: 23877
04-02 21:13:33.536 23877 24122 E   Surface                                      getSlotFromBufferLocked: unknown buffer: 0xb8f77c70

(https://i.sstatic.net/qObvb.png)

2
  • Concedeu permissão no AndroidManifest?
    – viana
    Commented 3/04/2017 às 10:14
  • 1
    Olá Ack Lay, concedi a permissão mas acho que no lugar errado. Estava dentro dá tag application. Reescrevi fora da tag e funcionou. Obrigado.
    – UltraSeven
    Commented 3/04/2017 às 21:27

1 Resposta 1

0

Verifique os seguintes itens:

  • Permissão de Internet no AndroidManifest.xml (<uses-permission android:name="android.permission.INTERNET" />)
  • Site existe realmente.

Fiz um teste com o site que você está tentando acessar: www.google.com.uk, porém ele não está acessível nem no browser. Faça um teste com o www.google.com.

2
  • 1
    Obrigado Carlos, migrei o uses-permition para fora da tag application e alterei o endereço para (google.com) e funcionou! Ocorre que o método abre uma instância do browser, mas o que eu preciso é de interagir com o site. Ler o código do site é submeter dados como se fosse um humano. Sabe me orientar em como fazer? Devo abrir outro tópico?
    – UltraSeven
    Commented 3/04/2017 às 21:23
  • @UltraSeven Sim, abra uma nova questão, aí poderemos te dar exemplos em outra resposta ;) Commented 3/04/2017 às 21:26

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .