Search code examples
c#androidunity-game-enginescreen-lock

How to lock/unlock android devices using unity and c#?


I looked all over the internet for a solution for a few days but couldn't find one that would help me lock/unlock an android device using unity programmatically. Mostly all the solutions are using android studio. Can some help me out please?


Solution

  • You need to create library that will help you to use Android's native featues like toast and notifications

    https://docs.unity3d.com/Manual/PluginsForAndroid.html

    https://docs.unity3d.com/Manual/AndroidAARPlugins.html