问题标签 [battery-saver]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
294 浏览

windows-phone-7 - How does the Calendar app on Windows Phone update its live tile even with the battery saver on?

I am trying to develop a simple calendar app with a live tile but in battery saver mode the background agent won't run and I can't have the live tile updated with the current day and day of week.

I noticed that the Calendar (1st party app) does not suffer from this problem even in Battery Saver mode.

Does it get special attention / capabilities being a first party app or there is some trick that I don't know (yet)?

0 投票
1 回答
5997 浏览

java - Android中的省电模式以编程方式控制?

是否可以通过代码打开/关闭省电模式?

暂时,我做唤醒锁获取和释放,但我认为,那是不一样的。

0 投票
0 回答
82 浏览

android - Android USB 十六进制输出和电池传感器工作

我正在做一个项目。我想通过 USB 端口将0xFF写入另一个具有电流放大器的电路。可以用安卓手机做到这一点吗?

其次,电池传感器如何在 Android 手机中工作,更清楚地说,当手机插入电源时 - 手机的 LED 变为红色,当电池完全充电时,红灯变为绿色。这怎么可能,是通过内部硬件还是软件实现的?

0 投票
5 回答
6876 浏览

android - Android GPS 和电池使用情况

我有 2 个 android 应用程序 A 和 B,它们都根据不同的参数读取 gps 值。考虑到这两个应用程序都在设备上运行,以下哪种方法会更好?

  1. A 和 B 都是不同的应用程序,每个应用程序都有一个从 GPS 读取的组件。

  2. 开发带有远程服务组件的第三个应用程序,将 GPS 数据传输到 A 和 B

是否会通过采用第二种方法来最小化电池使用量,或者 GPS 组件是否会读取一次并为所有进程提供服务,就像在操作系统中一样?

请帮忙

0 投票
1 回答
722 浏览

ios - 在 iOS 中实现延迟位置更新

我正在尝试在我的 iOS 应用程序中实现延迟位置更新功能。我了解此功能可显着降低使用 GPS 的位置感知应用程序的功耗。Apple 的文档以以下代码为例:

但是,当我开始输入时if (!self.d……“deferringUpdates”属性没有出现。这是为什么?

有没有人成功实现过这个功能?如果是这样,你能分享你的实现吗?谢谢你。

0 投票
2 回答
3428 浏览

python - Python script to charge and discharge laptop battery

A friend of mine recently inherited an old laptop and has freshly installed windows 7, and wants to increase the battery life. Initially the battery lasted around 20mins, but by manually allowing the battery to fully discharge before recharging, a few times, he has managed to increase the lifetime to around an hour. We thought it would be fun to see just how much we could increase the performance of the battery! and I thought to write a script to cycle the battery overnight - and this may be useful to occasionally run on any computer to maintain battery health? I can get the battery status, but cannot see how to instruct the laptop to ignore the presence of the AC powerline and use the battery. I have a feeling the answer is out there: https://pypi.python.org/pypi/LaptopControlPanel but I am completely at my limit with regards to my understanding! Any help would be great.

The first if statement is where I would like to force battery use... The above code is mostly stolen from In Python, how can I detect whether the computer is on battery power?.

Thank-you.

0 投票
1 回答
1798 浏览

android - 在 kitkat 4.4 中检查省电模式

Android KitKat 4.4 中有一种省电模式。它将优化 GPS 和其他功能以节省电池寿命。是否可以检查手机是否处于省电模式?

0 投票
1 回答
1172 浏览

android - Little Fluffy Location - 误解如何获取当前位置

我正在尝试使用Little Fluffy Location Library来获取我的小应用程序的位置信息。我让它在一个异步进程中运行,如下所示:

我在我的 onCreate() 中调用它。

userLoc.execute();

我用这个类扩展了我的应用程序:

公共类 FluffyLocation 扩展应用程序 {

@Override public void onCreate() { super.onCreate();

}

清单中的设置:

我知道它正在运行,因为每次活动运行时我都会让 TOAST 显示信息......我试图在每次用户打开应用程序时获取当前位置。我想我错过了这是如何工作的。我在想 latestInfo.refresh() 会给我最新的信息,但是,如果我搬到 200 米外的另一个位置,我仍然会得到相同的 lat/lng 和相同的 .lastLocationUpdateTimestamp。

我想获取当前用户位置,然后定期获取更新。由于这个原因,这个库似乎很完美......但我没有得到结果。我没有正确实施吗?

编辑::::

我没有实现广播接收器,但是,我不确定如何让它为多个类工作。我有 3 个不同的会询问用户位置...

0 投票
0 回答
397 浏览

android - Android 多 IntentService 耗尽电池

我有一个启动两个 IntentService 的应用程序。我进行了一些电流消耗测量,发现如果我启动一项执行音频记录和音频分析的服务,电流消耗约为 65mA。如果我启动另一台执行 BLE 扫描,则电流消耗约为 85mA。如果两个 IntentService 同时运行,我的电流消耗为 200mA。我在装有 Android 4.3 的三星 SIII 上对此进行了测量。同样在 Nexus 5 Android 4.4.2 中,当两个服务一起运行时,电池会耗尽。我没有使用唤醒锁。对此有解释吗?是否可以节省电池寿命?这两个 IntentService 根本不使用网络连接,它们不发送数据。

0 投票
1 回答
634 浏览

android - Android battery draining rate

I'm trying to design an app which changes it's behaviour according to battery draining rate. That is, there are two states state1 and state2. it checks for draining rate of each state. and switches over to the particular state which drains less battery.

so is it possible to check the draining rate of my app (in particular). ps: both the states use display and network connections.

if yes how can I get the draining rate?

I've noticed in the Battery options of android setting contains per app battery usage can I access these values?