質問

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