作者:苗淑香哈哈_405_408 | 来源:互联网 | 2023-01-21 13:28
Functionlikewindow.addEventListener(batterystatus,onBatteryStatus,false);functiononBattery
Function like
window.addEventListener("batterystatus", onBatteryStatus, false);
function onBatteryStatus(info)
{
// Handle the online event
console.log("Level: " + info.level + " isPlugged: " + info.isPlugged);
}
return battery level and status when event is fired. In normal case, how can I get status of battery run time without writing plugin.
事件发生时返回电池电量和状态。在正常情况下,如何在不编写插件的情况下获取电池运行时的状态。
Also if is there any API or other related/alternate solution, please mention.
如果有任何API或其他相关/替代解决方案,请提及。
1 个解决方案