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)
}