Back to project page BatteryDaydream.
The source code is released under:
Apache License
If you think the Android project BatteryDaydream listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package pl.patrykgrzegorczyk.batterydaydream.monitor; //from ww w. ja v a 2 s . co m import android.content.Context; import org.jetbrains.annotations.Nullable; /** * Monitors battery state. Start monitoring process by calling {@link #startListening()} and * stop by calling {@link #stopListening()}. {@link BatteryStateListener} is noticed about battery * state changes. */ public interface BatteryMonitor { @Nullable Context getContext(); void setContext(@Nullable Context context); void startListening(); void stopListening(); @Nullable BatteryStateListener getBatteryStateListener(); void setBatteryStateListener(@Nullable BatteryStateListener batteryStateListener); /** * Interface definition for a callback to be invoked when a battery state changed */ interface BatteryStateListener { /** * Called when a battery state has changed * @param batteryState actual battery state */ void onBatteryStateChanged(BatteryState batteryState); } }