codecamp

closeWifi

关闭wifi

closeWifi(callback(ret))

callback(ret)

ret:

  • 类型:JSON对象
  • 描述:返回关闭wifi是否成功
  • 内部字段:

{
    "result":1     //int类型,是否关闭成功 ,取值范围如下:
                   //0    关闭失败
                   //1    关闭成功
}

示例代码

var wifi = api.require('wifiMgr');
wifi.closeWifi(function(ret, err){
     alert(JSON.stringify(ret));
     });

补充说明

此接口仅支持Android平台

可用性

Android系统

可提供的1.0.0及更高版本

openWifi
toWifiSettingView
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

端API

设备访问

ipAddress

wifiSSID

smartConfigCheyw

无标题文章

前端框架

云API

开发工具

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }