所需工具:
iapp
聪明的大脑文章源自灵鲨社区-https://www.0s52.com/bcjc/iappjc/11063.html
勤劳的双手文章源自灵鲨社区-https://www.0s52.com/bcjc/iappjc/11063.html
文章源自灵鲨社区-https://www.0s52.com/bcjc/iappjc/11063.html
注意:本站只提供教程,不提供任何成品+工具+游戏链接,仅限用于学习和研究,禁止商业用途,未经允许禁止转载/分享等行为。文章源自灵鲨社区-https://www.0s52.com/bcjc/iappjc/11063.html
文章源自灵鲨社区-https://www.0s52.com/bcjc/iappjc/11063.html
教程如下:
文章源自灵鲨社区-https://www.0s52.com/bcjc/iappjc/11063.html
[php]文章源自灵鲨社区-https://www.0s52.com/bcjc/iappjc/11063.html
//**1.检测网络情况并效验设备时间是否准确文章源自灵鲨社区-https://www.0s52.com/bcjc/iappjc/11063.html
t()文章源自灵鲨社区-https://www.0s52.com/bcjc/iappjc/11063.html
{文章源自灵鲨社区-https://www.0s52.com/bcjc/iappjc/11063.html
hs("http://quan.suning.com/getSysTime.do",jk)
ufnsui()
{
time(0,js)
sj(js,":",":",tm)
sj(js,null,tm,dq)
sj(jk,"me2\":\"","\"",jss)
sj(jss,":",":",tmm)
sj(jss,null,tmm,sjj)
ss(dq+tm,bjsj)
ss(sjj+tmm,wbsj)
f(jk==null||jk=="")
{
tw("网络异常")
}
else f(bjsj==wbsj)
{
tw("网络正常")
}
else
{
tw("网络正常但系统时间异常,正在退出!")
endcode
end()
}
}
}
//**2.java检测设备网络情况
javanew(c5,"android.content.Context")
javags(k66,c5,"android.content.Context","CONNECTIVITY_SERVICE")
java(c6m,activity,"android.app.Activity.getSystemService","String",k66)
java(wif,c6m,"android.net.ConnectivityManager.getActiveNetworkInfo")
f(wif != null)
{
java(ss.rnink,wif,"android.net.NetworkInfo.isAvailable")
tw("有网络")
}
else
{
ss rnink=false
tw("无网络")
}
//建议两者搭配使用
//**例子
javanew(c5,"android.content.Context")
javags(k66,c5,"android.content.Context","CONNECTIVITY_SERVICE")
java(c6m,activity,"android.app.Activity.getSystemService","String",k66)
java(wif,c6m,"android.net.ConnectivityManager.getActiveNetworkInfo")
f(wif != null)
{
java(ss.rnink,wif,"android.net.NetworkInfo.isAvailable")
t()
{
hs("http://quan.suning.com/getSysTime.do",jk)
ufnsui()
{
time(0,js)
sj(js,":",":",tm)
sj(js,null,tm,dq)
sj(jk,"me2\":\"","\"",jss)
sj(jss,":",":",tmm)
sj(jss,null,tmm,sjj)
ss(dq+tm,bjsj)
ss(sjj+tmm,wbsj)
f(jk==null||jk=="")
{
tw("网络异常")
}
else f(bjsj==wbsj)
{
tw("网络正常")
}
else
{
tw("网络正常但系统时间异常,正在退出!")
endcode
end()
}
}
}
}
else
{
ss rnink=false
tw("无网络")
}[/php]
评论