Detect screen mirroring using xamarin.forms.android

后端 未结 2 1171
夕颜
夕颜 2020-12-22 12:37

I want to detect android screen mirroring to pc. I am currently coding in c# Xamarin Forms Android.

What I have done

Here s

相关标签:
2条回答
  • 2020-12-22 13:15

    Finally I got the working answer.
    Android mirrors like vysor can't mirror without having developer options enabled.
    To check whether mirror can be run, check this code below:

    //https://stackoverflow.com/a/31582092/11390822
    
    var context = Android.App.Application.Context;
    var resolver = context.ApplicationContext.ContentResolver;
    if (Settings.Secure.GetInt(resolver, Settings.Global.DevelopmentSettingsEnabled, 0) == 1)
    {
    //Developer options enabled
    //Mean vysor can mirror
    }
    else
    {
    //Developer options disabled
    //Mean vysor can't mirror now
    }
    

    0 讨论(0)
  • 2020-12-22 13:23

    It is not possible to do so in Android.

    Reference

    The closest you could get is by using FlagSecure to prevent screenshots.

    0 讨论(0)
提交回复
热议问题