如何在Android Prior API 17中检测外部显示 [英] How to detect external displays in android prior API 17

查看:58
本文介绍了如何在Android Prior API 17中检测外部显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用具有受版权保护的视频的应用程序,该视频应仅在Android设备上运行,而不能在通过HDMI或无线方式连接的外接显示器上运行.我发现很棒的API 演示文稿DisplayManager 来检测和控制要在外部显示器上显示的内容,但是此API仅在API 17(android 4.2)及更高版本中可用.在android 4.2以下或至少检测并通知连接的显示器方面如何执行此操作的任何想法.

I'm working in app that has copyrighted videos that should work only in Android device and not in external display connected via HDMI or wirelessly. I found great API Presentation and DisplayManager to detect and control which content to be displayed on external displays but this API's available only in API 17 (android 4.2) and plus. Any idea in how to do this below android 4.2 or at least to detect and be notified for connected displays.

问题2:如果将android设备连接到PC进行屏幕录制该怎么办.可以演示文稿

Question #2: What about if android device is connected to PC for screen recording. Can Presentation or DisplayManager API help to detect that?

推荐答案

关于如何在android 4.2以下执行此操作的任何想法,或者至少要检测并通知已连接的显示器.

Any idea in how to do this below android 4.2 or at least to detect and be notified for connected displays.

在Distwo的答案中指出,除了API级别16中的 MediaRouter 外,在较旧版本的Android中,不支持对外部显示器的应用程序级访问.相对很少的设备甚至支持外部显示器.那些只提供操作系统级屏幕镜像的服务器.

Beyond possibly MediaRouter in API Level 16 as noted in Distwo's answer, there was no support for app-level access to external displays in older versions of Android. Relatively few devices even supported external displays; those that did only offered OS-level screen mirroring.

您最好的选择是,尝试使用一些这样的设备,看看是否有任何常见的LogCat消息表明存在外部显示器,或者 /proc 中的一些Linux级别的东西.但是,很有可能这些最终会因制造商和设备而有所不同.

Your best bet, if you want to call it that, is to get your hands on a few such devices and see if there are any common LogCat messages that indicate the existence of external displays, or maybe some Linux-level stuff in /proc. However, there is a very good chance that these will wind up being different by manufacturer and device.

如果将android设备连接到PC进行屏幕记录该怎么办?Presentation或DisplayManager API可以帮助检测到吗?

What about if android device is connected to PC for screen recording. Can Presentation or DisplayManager API help to detect that?

否.

这篇关于如何在Android Prior API 17中检测外部显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆