user2889058
user2889058

Reputation: 135

Application Error - The connection to the server was unsuccessful.

<div data-role="footer" data-position="fixed"  >
        <div data-role="navbar" data-position="fixed">
            <ul>
                <li>
                    <a href="index.html#main_menu"  rel="external"  data-icon="home">Home</a>
                </li>

            </ul>
        </div>
    </div>

When i try this code in my phonegap application i get following error .I know this could be possible dupliacate.(It works perfectly in Samsung tab But not in Huwavi )

Application Error - The connection to the server was unsuccessful. (file:///android_asset/www/index.html)

Upvotes: 1

Views: 3704

Answers (3)

Kwoxford
Kwoxford

Reputation: 614

It might be caused by trying to debug. I had a weinre link in index.html that couldn't see my server - I removed it and the problem seemed to go away. In fact, any attempt to load an unavailable asset is likely to cause a timeout.

Upvotes: 1

Sunil Dodiya
Sunil Dodiya

Reputation: 2615

You need to increase "loadUrlTimeoutValue"

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.loadUrlTimeoutValue = 15000;
        loadUrl("file:///android_asset/www/index.html");
        if (Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN)
            appView.getSettings().setAllowUniversalAccessFromFileURLs(true);
        appView.getSettings().setNavDump(false);
    }

Upvotes: 1

user3110424
user3110424

Reputation:

This is caused by your App timing out. You can increase the time-out value,in your Application add this line to the java class before before loading your app url.

super.setIntegerProperty("loadUrlTimeoutValue", 60000);

Upvotes: 1

Related Questions