Is there a problem with internet access in Android browser due to proxy server?

Here is my problem:

The emulator (Android 2.2) has access to the Internet through a browser. (I'm behind the proxy server, so I install the proxy first)

but when I create the webview app, it looks like it cannot access the internet through webview.

<uses-permission android:name="android.permission.INTERNET"></uses-permission> 

. Therefore, I am afraid of this because of the proxy.

Any clue? Thanks.

+6
source share
2 answers

Try adding to OnCreate ()

 WebView.enablePlatformNotifications(); 

And adding the following manifest permissions

 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission> 

This should allow your webview to access the proxy information it needs. You may need to restart the emulator (hopefully not).

+9
source

For me, my applications cannot access web views unless I specify a DNS server for my Android simulators. This is how I solve the problem in eclipse:

  • Eclipse> Settings> Android> Launch:
  • Default emulator options:
  • dns-server 8.8.8.8

You should also add "-dns-server 8.8.8.8" for any Android startup configurations already created.

  • Run> Run Configurations> Select Android Project> Target Tab> Advanced emulator command line options:
  • Add "-dns-server 8.8.8.8" here.

Not sure if this will help with your problem, but hopefully it is.

+1
source

Source: https://habr.com/ru/post/892632/


All Articles