简体   繁体   English

以编程方式启用/禁用 Android 中的屏幕镜像。 [根]

[英]Programatically enable/disable screen mirroring in Android. [root]

I'm trying to develop an Android app which detects if screen mirroring is currently ON and enables/disables this functionality.我正在尝试开发一个 Android 应用程序,它检测屏幕镜像当前是否打开并启用/禁用此功能。

Is there any API I can use in order to achieve this?我可以使用任何 API 来实现这一目标吗?

You can remove functionality which mirrors.您可以删除镜像的功能
No software can mirror if developer option is disabled .如果禁用开发者选项,则任何软件都无法镜像。
This code will tell whether android can mirror or not.此代码将告诉 android 是否可以镜像。

int CanMirror = Settings.Secure.getInt(this.getContentResolver(), Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0);
//returns 1 if can mirror
//returns 0 if can't mirror

Reference : https://stackoverflow.com/a/63971764/11390822参考: https : //stackoverflow.com/a/63971764/11390822

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM