powermanagers
1.0.0
ไลบรารี Android เพื่อตรวจสอบตัวจัดการพลังงานที่ติดตั้งบนโทรศัพท์เช่นเดียวกับ Asus, Oppo, Sony, ฯลฯ ...
เพิ่มสิ่งต่อไปนี้ในโครงการของคุณ build.gradle:
allprojects {
repositories {
.. .
maven { url ' https://jitpack.io ' }
}
}และในแอพ/build.gradle เพิ่ม:
android {
.. .
dependencies {
implementation ' com.github.marcandreappel:powermanagers:1.0.0 '
}
} ในกิจกรรมใด ๆ (แต่ควรเร็วที่สุด) เพิ่มภายใต้ onCreate :
// Check for the presence of a powermanager
val powermanagerIntent : Intent ? = Powermanagers .present( this )
// If there's one, then open it
if (powermanagerIntent != null ) {
startActivity(powermanagerIntent)
}