Problem: I can see the URL opens in Android browser but phonegap app always says A network error occurred.

I had seen reference to this question at multiple locations, tried every solution I encountered and still didn't find a solution. I am trying to load a webpage served by intranet into phonegap app on android using following code:

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.init();
    //WebView.enablePlatformNotifications(); // Enable proxy
    //setContentView(R.layout.main);
    //super.loadUrl("file:///android_asset/www/index.html");
    this.setIntegerProperty("loadUrlTimeoutValue", 60000);
    super.loadUrl("http://10.32.147.28:9080/MYWeb/IndexView.do");
}

I tried commenting and uncommenting many possible combinations above. Here is the configuration: cordova_1.8.0.jar inside the app. cordova1.8.0.js is served by the page above and is not stored locally.

Appreciate any help.

有帮助吗?

解决方案

Have you set your application whitelist appropriate? You will need to whitelist your server IP.

http://docs.phonegap.com - on the left side, Domain Whitelisting Guide.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top