编译完成:
此时将工程导入到 eclipse中
画圈圈的地方就是 系统生成的代码
将下方语句考到 assets目录下 www/index.html 当中 完全复制过去;
example:
Apache Cordova
Connecting to Device
Device is Ready
代码详解:
var networkState = navigator.connection.type;
var states = {};
states[Connection.UNKNOWN] = ‘Unknown connection’;
states[Connection.ETHERNET] = ‘Ethernet connection’;
states[Connection.WIFI] = ‘WiFi connection’;
states[Connection.CELL_2G] = ‘Cell 2G connection’;
states[Connection.CELL_3G] = ‘Cell 3G connection’;
states[Connection.CELL_4G] = ‘Cell 4G connection’;
states[Connection.CELL] = ‘Cell generic connection’;
states[Connection.NONE] = ‘No network connection’;
navigator.connection.type 获取当前网络状态
states数组表示输出的状态 大家可以根据需要自己修改输出的参数
工程下载 将phonegap的platforms导入到eclipse中
如果报错clear一下 查看导的lib包 有没有报错
如果还有错 那么就是您选用了 google的API 改成最新版的android API 就好了
xcQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
工程下载 将phonegap的platforms导入到eclipse中
如果报错clear一下 查看导的lib包 有没有报错
如果还有错 那么就是您选用了 google的API 改成最新版的android API 就好了



