Can we get a notification if the phone’s battery starts charging? Regardless of whether the power source is a charger or a USB cable.
You can listen to the ACTION_BATTERY_CHANGED broadcast and check the power details with BATTERY_PLUGGED_ [AC / USB] (Check the data here ).
Source: https://habr.com/ru/post/1482629/More articles:Android: detect when ADB is active via USB - androidIs it possible to determine whether an Android device is connected to a computer or just power? - androidConvert string to ConnectionStringSettings - c #JGraphX takes a long time to build a graph - graphvideo.js - controls are not displayed in IE8 - flashReset default attribute - perlASP.NET C # get screen width in pixels - c #Asp.Net Get Screen Width - c #Problem with @ font-face and .ttf files - htmlCan't find the Java error symbol? - javaAll Articles