如何检查设备激活锁状态Android设备中的HDMI设备连接状态

如何检查Android设备中的HDMI设备连接状态_ZNDS网友问答
只需一步,快速开始
扫一扫,访问微社区
后使用快捷导航没有帐号?
TV应用下载 / 资源分享区
综合交流 / 产品评测 / 活动公告
新手入门 / 社区互助
查看: 241|回复: 0
如何检查Android设备中的HDMI设备连接状态
强烈推荐,装机必备软件!专为智能电视和安卓电视盒子打造的TV APP应用商店!追求极简体验,完美适配遥控器!海量精选TV应用,快下载体验吧!
电视运行慢,看视频卡、玩游戏卡、用浏览器还是卡,卡的人想砸电视怎么办?别担心,当贝助手来帮您!当贝助手,第一款专为电视打造的功能全面的当贝电视管家!
倡导极简高效的电视主题桌面,极致的自主操作和用户体验。并提供智能排序、自动清理、快捷管理等一系列贴心功能,帮助用户让智能电视变得真正简单好用。
没有你搜不到的影片!集点播直播一体,智能电视必备软件,覆盖全网的99%视频资源,电影电视、综艺动漫、教育体育等,你想看的都在这里!
增值电信业务经营许可证:浙B2- 丨 杭州市公安局滨江分局备案编号:71
Powered by Discuz!
监督举报: (请将#替换为@)I need to detect whether an HDMI device is connected or not to my Android device.
For this I'm using a BroadcastReceiver and it is able to detect also.
But with BroadcastReceiver I'm unable to handle the scenario when the HDMI device is connected even before my application was launced. In this case the BroadcastReceiver is unable to find if any HDMI device is connected or not.
Is there any way I can get to know if any HDMI device is connected or not at any point?
解决方案 I came up with this using the other answers and some from elsewhere:
* Checks device switch files to see if an HDMI device/MHL device is plugged in, returning true if so.
private boolean isHdmiSwitchSet() {
// The file '/sys/devices/virtual/switch/hdmi/state' holds an int -- if it's 1 then an HDMI device is connected.
// An alternative file to check is '/sys/class/switch/hdmi/state' which exists instead on certain devices.
File switchFile = new File("/sys/devices/virtual/switch/hdmi/state");
if (!switchFile.exists()) {
switchFile = new File("/sys/class/switch/hdmi/state");
Scanner switchFileScanner = new Scanner(switchFile);
int switchValue = switchFileScanner.nextInt();
switchFileScanner.close();
return switchValue & 0;
} catch (Exception e) {
If you're checking often, you'd want to store the result and update it with @hamen's listener.
本文地址: &
我需要检测HDMI设备是否已连接到我的Android设备。 对于这个我使用一个BroadcastReceiver,它也能够检测。 但是使用BroadcastReceiver时,即使在我的应用程序启动之前,我也无法处理HDMI设备连接的情况。在这种情况下,BroadcastReceiver无法找到是否连接了任何HDMI设备。
解决方案 有没有什么办法可以知道是否有HDMI设备在任何时候连接?我想出了这个使用其他答案和一些从其他地方:
*检查设备开关文件以查看是否插入了HDMI设备/ MHL设备,如果是则返回真。
private boolean isHdmiSwitchSet(){
//文件'/ sys / devices / virtual / switch / hdmi / state'拥有一个int
- 如果它是1然后连接HDMI设备。
//要检查的替代文件是'/ sys / class / switch / hdmi / state',而是存在于某些设备上。 文件switchFile =新文件(“/ sys / devices / virtual / switch / hdmi / state”);
if(!switchFile.exists()){ switchFile = new File(“/ sys / class / switch / hdmi / state”); }
try { Scanner switchFileScanner = new Scanner(switchFile);
int switchValue = switchFileScanner.nextInt();
switchFileScanner.close();
return switchValue& 0; } catch(Exception e){ } }
如果经常检查,以存储结果并用@ hamen的监听器更新。
本文地址: &
扫一扫关注官方微信查看: 7485|回复: 4
itools一直显示发现安卓设备连接中
阅读权限10
设备iPhone 5
在线时间0 小时
主题帖子兔元宝
itools一直显示发现安卓设备连接中
阅读权限10
设备iPhone 5
在线时间0 小时
主题帖子兔元宝
一直显示在连接,但是连接不上
阅读权限255
iPhone 3GS
在线时间663 小时
主题帖子兔元宝
一直显示在连接,但是连接不上
您好,请将安卓设备上的调试开关开启后重试、
欢迎加上我们itools企业QQ让我们的产品支持为您一对一解答。企业QQ:,期待为您服务!
阅读权限10
设备iPhone 6 Plus
在线时间0 小时
主题帖子兔元宝
我的也是没用啊。安卓的系统,华为mate7 电信版 16G 4.4.2
USB 打开,关闭,再打开,在关闭;没有反应
iphone5 可以顺利链接。 重新下载的ITUNES,还是不能链接。
阅读权限200
在线时间648 小时
主题帖子兔元宝
我的也是没用啊。安卓的系统,华为mate7 电信版 16G 4.4.2
USB 打开,关闭,再打开,在关闭;没有反应
您好,目前iTools安卓版本对安卓设备连接正在进行优化,我们已将该问题反馈给相关人员
请耐心等待后续版本的迭代才能进行修复
给您带来的不便,还请见谅
iTools 企业客服QQ: 相关问题也可联系QQ技术人员进行咨询,感谢您对iTools的支持与关注!
社区QQ达人
使用QQ帐号登录论坛的用户
论坛管理员
iTools论坛管理员专用勋章
iTools论坛帅哥勋章
十二生肖-戌狗
十二生肖-戌狗勋章,申请勋章需要扣除200金币
双子座勋章,申请勋章需要扣除200金币
积极宣传本站,为本站带来更多注册会员
站长推荐 /1
工作时间:周一至周五
9:00-18:00
官方客服微博扫一扫
Powered by

我要回帖

更多关于 android 检查wifi状态 的文章

 

随机推荐