My first jquery mobile app contains elements which needs datas from Internet sources like public Google calendars and Amazon affiliate widgets but it works only when I testi
For checking internet connection I use this function:
function checkConnection(){
var networkState = navigator.connection.type;
if(Connection.NONE==networkState)
return "<p>No connection</p>";
}
For being able yo use it you have to add the network state plugin this way:
cordova plugin add cordova-plugin-network-information
Your AndoidManifest file should include this two lines:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Add the whitelist plugin
<gap:plugin name="cordova-plugin-whitelist" source="npm" />
You might need to add this meta tag on the head
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src * 'unsafe-inline'; script-src * 'unsafe-inline'; media-src *">
And add this two lines to the config.xml
<allow-navigation href="http://*/*" />
<allow-intent href="https://*/*" />