How to turn off Android phone programmatically?

后端 未结 3 653
轮回少年
轮回少年 2021-01-05 13:33

I want to make a lock screen application. When the phone is in the lock mode, it will turn off the phone while the USB is plugged for prevent other users from accessing the

相关标签:
3条回答
  • 2021-01-05 14:08

    Yes it is possible,

    Using making system application(Using firmware) not download application. You can get the code for power off android device from AOSP.

    0 讨论(0)
  • 2021-01-05 14:23

    This is what can provide you an insight of the OS you are working on , and not about developing an app that would run on any device, as you have not made OS's for them.

    Just pull a branch of android , customize it according to your wish and in your mainfest remove the filters, permissions that don't allow you to do that, or add your owns. Now , you have to play with the battery if I talk of more depth.

    But if you just want to trigger the click on power off then its far simpler then.

    0 讨论(0)
  • 2021-01-05 14:24

    It is impossible with the public Android SDK.

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