电视盒子开机自启动wifi热点功能代码,貌似路由器都能省了

上传者: xiaoxiao108 | 上传时间: 2021-09-29 11:04:09 | 文件大小: 1.39MB | 文件类型: RAR
http://blog.csdn.net/xiaoxiao108/article/details/31398127 现在用有线连网看视频速度要比经过路由器快,用无线做热点,但无线设置热点后,关机或重启又要再重新开启热点,这样比较麻烦,增加上开机自启热点,这样比较方便了,连网速度快看视频不卡其它设备也可以通过盒子上网。 开发工具 android ADT 实现方法 1.开启热点 2.开机启动 具体代码 1.开启热点 [java] view plaincopy在CODE上查看代码片派生到我的代码片 WifiManager wifiManager; wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); Method method = wifiManager.getClass().getMethod("getWifiApState"); int state = (Integer) method.invoke(wifiManager); if(state==13||state==12)// 已经开 或者 正在开 { }else { Toast.makeText(MainActivity.this,"正在开启AndroidAP...", 1).show(); wifiManager.setWifiEnabled(false); WifiConfiguration apConfig = new WifiConfiguration(); apConfig.SSID = "AndroidAP"; apConfig.allowedKeyManagement.set(4); apConfig.preSharedKey = "5e8918f37260"; method = wifiManager.getClass().getMethod("setWifiApEnabled", WifiConfiguration.class, Boolean.TYPE); boolean open = (Boolean) method.invoke(wifiManager, apConfig, true); } AndroidManifest.xml 中增加权限 2.开机启动 用了用 在我的电视盒子上试了试 发现 偶尔会出现 开机不自动运行的情况 换个思路把 用 替代 电视盒子自带的 桌面 开启AP热点后再 自动运行盒子自带的桌面 [java] view plaincopy在CODE上查看代码片派生到我的代码片 ComponentName componet = new ComponentName("com.duokan.duokantv","com.duokan.duokantv.MainActivity"); Intent i = new Intent(); i.setComponent(componet); startActivity(i); 使用方法 1.电视盒子连有线网 2.配置好盒子正常上网 3.安装自己写好的程序 如果你发现有什么不合理的,需要改进的地方,请留言。或者可以通过 328452421@qq.com 联系我,非常感谢。 http://blog.csdn.net/xiaoxiao108/article/details/31398127

文件下载

资源详情

[{"title":"( 53 个子文件 1.39MB ) 电视盒子开机自启动wifi热点功能代码,貌似路由器都能省了","children":[{"title":"test9","children":[{"title":".project <span style='color:#111;'> 808B </span>","children":null,"spread":false},{"title":".DS_Store <span style='color:#111;'> 6.00KB </span>","children":null,"spread":false},{"title":"project.properties <span style='color:#111;'> 563B </span>","children":null,"spread":false},{"title":"src","children":[{"title":".DS_Store <span style='color:#111;'> 6.00KB </span>","children":null,"spread":false},{"title":"com","children":[{"title":".DS_Store <span style='color:#111;'> 6.00KB </span>","children":null,"spread":false},{"title":"example","children":[{"title":".DS_Store <span style='color:#111;'> 6.00KB </span>","children":null,"spread":false},{"title":"test9","children":[{"title":"MainActivity.java <span style='color:#111;'> 3.02KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"AndroidManifest.xml <span style='color:#111;'> 1.21KB </span>","children":null,"spread":false},{"title":"res","children":[{"title":"drawable-ldpi","children":null,"spread":false},{"title":"drawable-hdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 7.48KB </span>","children":null,"spread":false}],"spread":true},{"title":"values-v11","children":[{"title":"styles.xml <span style='color:#111;'> 324B </span>","children":null,"spread":false}],"spread":true},{"title":"menu","children":[{"title":"main.xml <span style='color:#111;'> 356B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 3.69KB </span>","children":null,"spread":false}],"spread":true},{"title":"layout","children":[{"title":"fragment_main.xml <span style='color:#111;'> 687B </span>","children":null,"spread":false},{"title":"activity_main.xml <span style='color:#111;'> 324B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 24.20KB </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 12.22KB </span>","children":null,"spread":false}],"spread":false},{"title":"values-w820dp","children":[{"title":"dimens.xml <span style='color:#111;'> 373B </span>","children":null,"spread":false}],"spread":false},{"title":"values","children":[{"title":"strings.xml <span style='color:#111;'> 215B </span>","children":null,"spread":false},{"title":"styles.xml <span style='color:#111;'> 680B </span>","children":null,"spread":false},{"title":"dimens.xml <span style='color:#111;'> 213B </span>","children":null,"spread":false}],"spread":false},{"title":"values-v14","children":[{"title":"styles.xml <span style='color:#111;'> 381B </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":".settings","children":[{"title":"org.eclipse.core.resources.prefs <span style='color:#111;'> 86B </span>","children":null,"spread":false}],"spread":true},{"title":"assets","children":null,"spread":false},{"title":"gen","children":[{"title":"com","children":[{"title":"example","children":[{"title":"test9","children":[{"title":"BuildConfig.java <span style='color:#111;'> 159B </span>","children":null,"spread":false},{"title":"R.java <span style='color:#111;'> 2.58KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"libs","children":[{"title":"android-support-v4.jar <span style='color:#111;'> 612.87KB </span>","children":null,"spread":false}],"spread":true},{"title":".classpath <span style='color:#111;'> 466B </span>","children":null,"spread":false},{"title":"proguard-project.txt <span style='color:#111;'> 781B </span>","children":null,"spread":false},{"title":"ic_launcher-web.png <span style='color:#111;'> 50.19KB </span>","children":null,"spread":false},{"title":"bin","children":[{"title":"resources.ap_ <span style='color:#111;'> 40.41KB </span>","children":null,"spread":false},{"title":"classes","children":[{"title":".DS_Store <span style='color:#111;'> 6.00KB </span>","children":null,"spread":false},{"title":"com","children":[{"title":".DS_Store <span style='color:#111;'> 6.00KB </span>","children":null,"spread":false},{"title":"example","children":[{"title":".DS_Store <span style='color:#111;'> 6.00KB </span>","children":null,"spread":false},{"title":"test9","children":[{"title":"R$layout.class <span style='color:#111;'> 437B </span>","children":null,"spread":false},{"title":"R$style.class <span style='color:#111;'> 428B </span>","children":null,"spread":false},{"title":"R$dimen.class <span style='color:#111;'> 458B </span>","children":null,"spread":false},{"title":"MainActivity$PlaceholderFragment.class <span style='color:#111;'> 932B </span>","children":null,"spread":false},{"title":"BuildConfig.class <span style='color:#111;'> 343B </span>","children":null,"spread":false},{"title":"R$drawable.class <span style='color:#111;'> 404B </span>","children":null,"spread":false},{"title":"R$attr.class <span style='color:#111;'> 337B </span>","children":null,"spread":false},{"title":"R$id.class <span style='color:#111;'> 423B </span>","children":null,"spread":false},{"title":"R.class <span style='color:#111;'> 663B </span>","children":null,"spread":false},{"title":"R$string.class <span style='color:#111;'> 469B </span>","children":null,"spread":false},{"title":"R$menu.class <span style='color:#111;'> 385B </span>","children":null,"spread":false},{"title":"MainActivity.class <span style='color:#111;'> 3.50KB </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":false}],"spread":false},{"title":"AndroidManifest.xml <span style='color:#111;'> 1.21KB </span>","children":null,"spread":false},{"title":"dexedLibs","children":[{"title":"android-support-v4-1a1547e1d9f283383e978930afde527a.jar <span style='color:#111;'> 228.94KB </span>","children":null,"spread":false}],"spread":false},{"title":"jarlist.cache <span style='color:#111;'> 120B </span>","children":null,"spread":false},{"title":"res","children":[{"title":"crunch","children":[{"title":"drawable-hdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 5.82KB </span>","children":null,"spread":false}],"spread":false},{"title":"drawable-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 3.04KB </span>","children":null,"spread":false}],"spread":false},{"title":"drawable-xxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 17.47KB </span>","children":null,"spread":false}],"spread":false},{"title":"drawable-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 9.14KB </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":false},{"title":"test9.apk <span style='color:#111;'> 274.50KB </span>","children":null,"spread":false},{"title":"classes.dex <span style='color:#111;'> 679.14KB </span>","children":null,"spread":false}],"spread":true}],"spread":false}],"spread":true}]

评论信息

  • wyzhappyer :
    测试下测试下
    2018-07-05
  • qq_31152869 :
    你这个叫开机自启动?
    2017-08-10
  • ywgdjryf :
    可否介绍下怎么安装到盒子里面?
    2016-02-27
  • ujacky :
    热点能自动打开,但不能动态设置账户信息,如果能增加设置功能就更好了
    2016-02-17
  • cxm120889651 :
    在手机oppo r7c 上开启热点成功,就是无法设置密钥,这是个缺点,但是一个开放热点,另外启动程序成功,我启动的是vst,直播,相当于老人模式。回头在电视盒子上实验下。
    2016-01-22

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明