power-saving

How to check if the Battery Saver Mode is enabled on Android < 5.0?

旧街凉风 提交于 2020-06-13 17:44:33
问题 As I know, there are some devices with version < 5.0 that have the Power Saver option. An answer provided in this similar question is not correct and doesn't explain anything. On Android 5.0+ we can use this script here: PowerManager powerManager = (PowerManager) this.getSystemService(Context.POWER_SERVICE); if ( powerManager.isPowerSaveMode()) { //code } My question is: is there a universal way to check if there IS a power saver mode and if it's enabled/disabled on API < 21? 回答1: For KitKat

Disabling or detecting the app specific power saving mode

自闭症网瘾萝莉.ら 提交于 2019-12-31 10:39:47
问题 Samsung devices (well, at least some of them) add all installed apps to an "App Power Saving Mode" list which affects the background services listening to some crucial info for the app. Some apps, somehow, disable this mode after installation without any extra steps. Comments on Programmatically disable app power saving mode on Samsung thread suggest that apps like Facebook and WhatsApp might be in the OS whitelist but I've seen apps that are not as popular doing the same. Any idea how to

Power saving mode in Android controlled programmatically?

南笙酒味 提交于 2019-12-20 05:22:12
问题 Is it possible to turn ON/OFF power saving mode from code? For the time being, I do wakelock acquire and release, but I assume, that is not the same. 回答1: There aren't any publicly available API's to do this in the SDK. You can use the PowerManager to acquire and release wakelocks but that's about it. Besides, every manufacturer and device might have it's own version of what it means by "power saving mode", so it doesn't make sense to give 3rd party app developers an API to interact with the

What is system API for stoping Doze for an App on Android Marshmallow

别来无恙 提交于 2019-12-10 18:21:00
问题 I am looking for android system API implementation for avoiding Doze for particular application. Rather requesting user to confirm adding in whitelisted app for doze. 来源: https://stackoverflow.com/questions/39873417/what-is-system-api-for-stoping-doze-for-an-app-on-android-marshmallow

Prevent tablet from sleeping while app is running

≡放荡痞女 提交于 2019-12-07 06:12:17
问题 I'm trying to write a Windows 8 tablet app that often can go multiple minutes between receiving input. The problem is, that if i don't keep touching the screen, the power saver will activate, and the screen will automatically go black, and it disrupts the user of the app. Is there a way that my app can prevent the power saver from activating, or at least extend the time it takes for the power saver to activate. 回答1: You should use DisplayRequest class to keep screen from turning off. Apps

How do I make my android app appear in Ultra Power Saving Mode

橙三吉。 提交于 2019-12-05 12:26:10
问题 Some samsung devices have an Ultra Power Saving Mode which turns off wifi, turns the screen grayscale and limits usage to a few basic apps. It however does allow you to add some apps which can then be used. These apps include Facebook and WhatsApp. How do I make my app appear in this list? What changes do I have to make to the app so that it may appear on this list? Or is this list based on a white list maintained by Samsung? 回答1: It may be possible using the permission REQUEST_IGNORE_BATTERY

Avoid app throttling when Electron is in background

北城余情 提交于 2019-12-04 04:50:50
Consider the following example: setInterval(function() { console.log(new Date()); }); If I run it with electron example.js under OS X, it opens up an icon in my dockbar and starts printing out the time on the console. If the app is not focused, however, after a while it starts throttling. I looked around and found that this is due to OS X power saving strategy. Now, what if I needed it to keep working in background? My app will be a daemon doing a little bit of something every now and then, and I can't have my users blankly staring at my app for ages. I found out here that I can do electron

How do I make my android app appear in Ultra Power Saving Mode

杀马特。学长 韩版系。学妹 提交于 2019-12-03 22:24:17
Some samsung devices have an Ultra Power Saving Mode which turns off wifi, turns the screen grayscale and limits usage to a few basic apps. It however does allow you to add some apps which can then be used. These apps include Facebook and WhatsApp. How do I make my app appear in this list? What changes do I have to make to the app so that it may appear on this list? Or is this list based on a white list maintained by Samsung? It may be possible using the permission REQUEST_IGNORE_BATTERY_OPTIMIZATIONS . This permission does not require explicit user permission. So will be granted. Although