使用PhoneGap的我的缓存经验的Android。
1. I want to create one app which should work online as well as offline.
2. If internet connectivity is there it should use otherwise use the history.
现在它..但我需要工作,我在离线应用程序太联机工作。 用于检查网络连接:
function onDeviceReady() {
navigator.network.isReachable("phonegap.com", reachableCallback, {});
navigator.notification.alert("Server Is Ready");
}
// Check network status
//
function reachableCallback(reachability) {
// There is no consistency on the format of reachability
var networkState = reachability.code || reachability;
var states = {};
states[NetworkStatus.NOT_REACHABLE] = 'No network connection';
states[NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK] = 'Carrier data connection';
states[NetworkStatus.REACHABLE_VIA_WIFI_NETWORK] = 'WiFi connection';
alert('Connection type: ' + states[networkState]);
}
任何一个可以帮助我来访问我的我的应用程序,而没有任何nwtwork连接(离线)