Reputation: 135
<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
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
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
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